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

[Feedback]: Repetitive header parameters #141

Open
lcawl opened this issue Oct 25, 2024 · 1 comment
Open

[Feedback]: Repetitive header parameters #141

lcawl opened this issue Oct 25, 2024 · 1 comment
Assignees

Comments

@lcawl
Copy link
Contributor

lcawl commented Oct 25, 2024

Was the documentation helpful?

Yes

What documentation page is affected

The generated content in the Kibana APIs, for example the operations under https://www.elastic.co/docs/api/doc/kibana/group/endpoint-roles

Description

Per feedback from @sophiec20 can avoid repeating common parameters (e.g. the elastic-api-version)?

This will require investigation of whether OpenAPI supports defining parameters at a document level rather than at an operation level. If it's supported, it will be a matter of confirming that we can create those via the OpenAPI generator and that they display as expected when published.

ES_FEEDBACK_ID: lVtk2pIBWCMSeP1od2Y_

@lcawl lcawl self-assigned this Nov 5, 2024
@lcawl
Copy link
Contributor Author

lcawl commented Nov 5, 2024

Per https://swagger.io/docs/specification/v3_0/describing-parameters/#common-parameters you can have:

  • Common parameters for all methods of a path: "Parameters shared by all operations of a path can be defined on the path level instead of the operation level. Path-level parameters are inherited by all operations of that path", and
  • Common parameters for various paths: "Note that the parameters defined in components are not parameters applied to all operations — they are simply global definitions that can be easily re-used"

I tested that in both cases the "common parameters" are displayed for each affected operation in Bump.sh. IMO this is appropriate behaviour, since otherwise you're assuming users know to scroll up to find the full set of parameters defined somewhere else on the site. If it is the desired behaviour to have a set of parameters (e.g. elastic-api-version) that is applicable across all operations but not listed under each operation, I think the only way to accomplish this would be to remove it from the automated API document and describe it in an introductory topic instead (like we've done for the space ID in https://www.elastic.co/docs/api/doc/kibana/topic/topic-kibana-spaces). IMO this would only be acceptable if the parameter has the same supported values for all operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant