-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iop-openapi: fix schema details with ref to component
In OpenAPI, components schemas can be declared independently, and then referred to to avoid duplication. However, when referencing an existing schema, no other information can be provided. This means that a field of a struct whose type has its own schema must use a '$ref', but then cannot specify anything else, especially no default value, no description, no constraints... This is a pretty bad overlook from the OpenAPI spec: �ihttps://github.com/OAI/OpenAPI-Specification/issues/1514 The proposed workaround is to use an untyped schema with all the details, and push the $ref inside an allOf clause, on its own. This is what is done in this commit. As you can see, this is pretty bad semantically, and I can't really imagine expecting a client to properly understand what it means, but that's the solution... Change-Id: Ifdba5fe6a7a2494aa136ec3ea3f0952edd45d6d0
- Loading branch information
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters