Open handrews opened 6 months ago
Good catch! I think:
@handrews what's the expected behavior here?
> GET /surname.yaml
> Accept: application/openapi+yaml;version=3.0;component=Schema
< HTTP/1.1 200 OK
< Content-Type: application/openapi+yaml;version=3.0;component=Schema
<
< Surname:
< type: string
< example: Rossi
> GET /surname.yaml
> Accept: application/openapi+yaml;version=3.0;component=Schema
< HTTP/1.1 200 OK
< Content-Type: application/openapi+yaml;version=3.0;component=Schema
<
< type: string
< example: Rossi
I might debate component
vs object
but both are arguably correct (the first referencing the Components Object and the second referencing general Object terminology.
Hmm... I might have resolved my own bikeshedding, as "Object" includes non-referenceable Objects, but Components are always referenceable. So I agree that component
is probably better than object
.
Thinking more, someone might think that component
gets them a specific component by name, as that is one of several ways in which you can connect to a component. In 4.0, we might move to "referencing" by component name rather than JSON Pointer fragment, so this could be an important distinction in the future.
So it might better to use componentType
or just type
(sigh... it's so overloaded, I know... I was using otype
at one point but it's rather cryptic) to distinguish between types of components and individual components. 🤔
I was guessing whether the usage of the new parameter is ok in the request/response.
We can bikeshed the name later on. I just wanted to avoid overloaded names like type/object for now, since I initially confused object-type
with the JSON Schema type: object
;)
It is common practice (particularly in OAS 2.0 and 3.0) to create documents that consist of a referenceable OAS Object (meaning any capitalized-in-the-spec Object type that either has an entry in the Components Object (3.0, 3.1) or is a 3.0 Path Item Object (it is referenceable but in that version did not have a Components Object section), or if 2.0 is covered any of the five different Definitions Objects.
If we want these to be able to have media types, then we probably need to support an
object-type
or similar Media Type parameter. While 3.1 added the ability to wrap re-usable components in complete documents without having to define API paths, this sort of split remains supported and in common use.I don't know if we want to add this complexity, but it's a significant use case. It also introduces the corner case that a JSON Schema document could alternatively have a media type like
application/openapi+yaml;object-type=Schema
, which would be useful if the OpenAPI media types are ready for standardization before the JSON Schema media types.