-
Notifications
You must be signed in to change notification settings - Fork 0
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
PSADv1: specify the content body using "mediatype", not "resource" #103
Comments
Maybe the indirection is kind of nice? We'd still need to add Another possibility would be to construct the media type via convention, ex:
where That is, rather than burden the developer with figuring this out, we just do the right thing by default. Later, we could (if people demand it), add a Also, technically, we will want eventually to allow for an arrays of types in the signature. Or perhaps an array of versions? So we'd end up with something like this:
|
We should definitely have multiple mediatypes allowed for request/response bodies. In addition to having signatures:
request:
schema:
- "#/blurb"
- "https://schema.blurb9.com/v1#blurb" |
@automatthew I'm unsure if you intended this or if we're talking past each other, but that's more or less the opposite direction of what I'm suggesting. Can't we incorporate external schemas by reference? That is, in the schema itself. |
The first round of work, for expedience, specifies the schema for the request or response body using a reference to a key in the dictionary of JSON Schemas.
Using a media-type is preferable, and part of the original redesign for PSAD.
To make this work, each schema in the API Description must declare a "mediaType" at its top level. Unfortunately, the API Gateway JSON Schema validator is slightly non-compliant, disallowing unknown keywords. We can handle this by stripping the "mediaType" property from the schema definition we use to define API Gateway Models in the CloFoTemp.
This addition will not break existing apps, which may transition to using
mediatype
instead ofresource
in the api.yaml at will.The text was updated successfully, but these errors were encountered: