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

AEP-156: provide a way to differentiate singletons and collections #268

Open
toumorokoshi opened this issue Jan 17, 2025 · 0 comments
Open
Milestone

Comments

@toumorokoshi
Copy link
Member

Today, singletons and collections same the same resource path. For example, a GET on /clusters/{cluster}/instance may be either a collection, or a singleton. Although instance is singular and perhaps a human can determine that it is a singular, a machine cannot reliably determine that the path is a singleton.

This is problematic for things like the OpenAPI linter, which must have some heuristic to determine if the path is a collection, and therefore should have a different set of linter rules applied to it.

Some ideas floated around include:

  • Doing something similar to the IBM styleguide, where it looks for an array of objects and some field that is only common on collections (e.g. skip or offset).
  • Adding an annotation (x-aep-collection) to the OpenAPI description.
  • Using a media content type to specify that the response is a collection (e.g. application/collection+json.

CC @mkistler @hudlow

@toumorokoshi toumorokoshi added this to the 0.1 milestone Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant