From how I understand the OpenAPI 3.0 spec, the following should be allowed and work as expected:
components:
schemas:
Foo:
type: string
Bar:
$ref: '#/components/schemas/Foo'
but since type Definitions = InsOrdHashMap Text, which is in turn used in Components (withoutReferenced), this doesn't parse correctly. This PR changes Definitions so that a Referenced is added in between, and updates other code to deal with the new possibility of a Ref. This is of course a breaking change.
(One use case for writing specs like this is in Haskell code generation: in Chordify's internal tool, a schema that's just a ref to another schema is turned into a newtype of that schema.)
From how I understand the OpenAPI 3.0 spec, the following should be allowed and work as expected:
but since
type Definitions = InsOrdHashMap Text
, which is in turn used inComponents
(withoutReferenced
), this doesn't parse correctly. This PR changesDefinitions
so that aReferenced
is added in between, and updates other code to deal with the new possibility of aRef
. This is of course a breaking change.(One use case for writing specs like this is in Haskell code generation: in Chordify's internal tool, a schema that's just a ref to another schema is turned into a newtype of that schema.)