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

[DOCS] Add examples to API endpoints #2482

Closed
65 tasks done
szabosteve opened this issue Apr 4, 2024 · 2 comments
Closed
65 tasks done

[DOCS] Add examples to API endpoints #2482

szabosteve opened this issue Apr 4, 2024 · 2 comments
Assignees

Comments

@szabosteve
Copy link
Contributor

szabosteve commented Apr 4, 2024

Description

Add examples to the API endpoints.

  • Use YAML format instead of JSON, since it supports comments. For example, conversion can be done via https://marketplace.visualstudio.com/items?itemName=tuxtina.json2yaml
  • Put the examples in "request" and "response" subfolders alongside the appropriate specifications. If you know the response code, use a "200_response" subfolder, for example.
  • To prevent duplicated work, leave your name beside a namespace/API you start working on.
  • The list contains only the API namespaces (for example, indices), you can expand the list granularly by adding the endpoints related to the namespace you work on in case it helps track the effort (for example, if you don't cover the whole namespace in one PR).
  • Add your PR URL next to the related namespace/API.
  • Adjust the list if you find any missing namespaces/endpoints.
  • Leave relevant notes either in the list or in a comment.

NOTE: Until there's an automated method for associating examples with endpoints, we're accomplishing it via overlays. Reach out to @lcawl if assistance is required.

API namespace inventory:

@lcawl
Copy link
Contributor

lcawl commented Jul 31, 2024

In case it's useful to other folks wanting a small (temporary) preview document, https://docs.bump.sh/guides/openapi/augmenting-generated-openapi/ mentions https://github.com/Mermade/openapi-filter/, and I was able to use it to strip out smaller subsets of the document. For example, to pull out only the operations that have the tag "transform.put_transform"):

npm install --global openapi-filter
make overlay-docs
openapi-filter -i --flags transform.put_transform --checkTags --info --valid -- output/openapi/elasticsearch-serverless-openapi.new.json output/openapi/filtered.json
bump preview output/openapi/filtered.json

@szabosteve
Copy link
Contributor Author

Related PR that simplifies the folder structure: #2779

@lcawl lcawl closed this as completed Jan 27, 2025
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

2 participants