Skip to content

Specifying dynamic resources enumerating valid values for a given path element #1693

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

Closed
jerstlouis opened this issue Sep 21, 2018 · 5 comments

Comments

@jerstlouis
Copy link

jerstlouis commented Sep 21, 2018

Say we wanted to list all possible tiling schemes for a given collectionID in:

/collections/{collectionID}/tiles/{tilingSchemeID}/{zoomLevel}/{row}/{column}.{ext}

Could we somehow describe something like this in a generic API specification?

{tilingSchemeID} : look at /collections/{collectionID}/tiles/tilingSchemes.json
@MikeRalphson
Copy link
Member

I am assuming that the list of possible values for tilingSchemeID does not vary depending on the value of collectionID -(because the collectionID values would need to be known ahead-of-time) correct me if I'm wrong.

An in:path parameter's schema can define an enum property, with an array of the possible values. You can refer to an external schema object in another document using a $ref, but you cannot use a $ref in place of just the enum property.

You cannot use OAS parameter names as templated variables in $ref values or descriptions.

@jerstlouis
Copy link
Author

@MikeRalphson , the list of possible tilingSchemeID could potentially vary depending on the value of collectionID, yes.

@MikeRalphson
Copy link
Member

OK - then OAS currently does not have a mechanism for pointing at a dynamic resource which provides the allowable values for a parameter (potentially based on other parameters).

@jerstlouis
Copy link
Author

Thanks for confirming this. So this is a feature request.

@jerstlouis jerstlouis changed the title Specifying resources enumerating valid values for a given path element Specifying dynamic resources enumerating valid values for a given path element Sep 21, 2018
@handrews
Copy link
Member

This is really a JSON Schema question, and the JSON Schema issue is json-schema-org/json-schema-spec#855

I'm going to close this as OAS 3.1 and later now fully reference JSON Schema, so the appropriate place to discuss this is in the JSON Schema issue.

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

3 participants