mnahkies / openapi-code-generator

A code generation tool for openapi 3 / 3.1 specifications written in typescript, primarily aimed at generating typescript clients and server stubs. Other target languages may be added in future.
https://openapi-code-generator.nahkies.co.nz/
MIT License
20 stars 2 forks source link

fix: allow $ref to be used as a schema property #250

Closed mnahkies closed 1 month ago

mnahkies commented 1 month ago

The SCIM v2 RFC includes a property named $ref on group membership, etc

Eg: https://datatracker.ietf.org/doc/html/rfc7643

{
            "name" : "$ref",
            "type" : "reference",
            "referenceTypes" : [
              "User",
              "Group"
            ],
            "multiValued" : false,
            "description" : "The URI of the corresponding 'Group'
resource to which the user belongs.",
            "required" : false,
            "caseExact" : false,
            "mutability" : "readOnly",
            "returned" : "default",
            "uniqueness" : "none"
          },

Previously we were naively trying to resolve any $ref key we found as an OpenAPI reference

Now we still naively do this, but only if it quacks like a real $ref