Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting x-state in the help center #319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/_help/specification-support/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@ This custom property allows you to identify some components of your
documentation as beta. Find out more in our [dedicated
section](/help/specification-support/doc-beta).

## Give precision to the state of your features (`x-state`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wording could be more impactful here.
Our users have often referred to this feature as “badges.” Therefore, I’d lean towards something like “Operation Status Badges”, “Endpoint Status Badges", or even "Status Badges". Or maybe something around "tag" ?

It should be something easily searchable using terms like “status” or “badge.”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully agree that it should be mentioned up there!

As of 'tags' or 'badges', you're also right. Badges are tags you can't interact with. So we should harmonize to 'badges' everywhere.


This custom property can be added inside an operation or a property to identify it with a custom tag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have added some contextual elements around the feature, such as use cases or examples of how it could be valuable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the use cases from this week's lead.
For existing clients, it was use to mention the version of the API this element was added in ("Added in 1.2.3"), or to mention a "Technical Preview", so to explain that it's still under heavy development.

The `x-state` property is a string.

### Example usage

Here under is an example of an operation and a property with a `x-state`.

```yaml
paths:
/diffs:
post:
tags: ["x-state"]
description: Create a diff between any two given API definitions
x-state: Technical preview # x-state flag at the operation level
requestBody:
description: The diff creation request object
content:
application/json:
schema:
type: object
properties:
url:
type: string
format: uri
x-state: Still unstable # x-state flag at the object property level
description: |
**Required** if `definition` is not present.
Current definition URL. It should be accessible through HTTP by Bump.sh servers.
```

Adding or removing this property is a structural change.
Copy link
Contributor

@ChristopheDujarric ChristopheDujarric Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

structural change

I recommend that we clarify what this means and what is the impact.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we would have to do the same for beta (I took this sentence from there).

When combined with the `x-beta`, the `x-state` replaces its value, but keeps the beta behavior: a change in a beta component is never identified as a breaking change.

The documentation displays custom tags on the operation and property:

![doc-beta.png](/images/help/doc-x-state.png)


## Get feedback from users (`x-feedbackLink`)

This custom property allows you to add a button to your documentation that enables you to collect feedback from your users. Find out more in our [dedicated
Expand Down
Binary file added src/images/help/doc-x-state.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you share a link to this example, I may be able to suggest a better screenshot. For instance, I could check if it’s the right dimensions, follows the appropriate template, and perhaps add a highlight to emphasize the badge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sent you the API, if you want a better image 😌

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading