ietf-wg-httpapi / mediatypes

Other
5 stars 4 forks source link

Object Type parameter for OAS media type #110

Open handrews opened 3 months ago

handrews commented 3 months ago

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.