Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unreachableDefinitions doesn't work without declareExternallyReferenced #652

Open
patrickbenjamin1 opened this issue Feb 17, 2025 · 0 comments

Comments

@patrickbenjamin1
Copy link

I have many schema files, some of which contain multiple schemas through $defs

i.e.

{
  "$defs": {
    "CreateThingRequestBody": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        }
      }
    },

    "CreateThingResponseBody": {
      "properties": {
        "thing": {
          "$ref": "/schemas/entities/thing.schema.json"
        }
      },
      "additionalProperties": false
    }
  }
}

From the above file, I'd like to be able to generate a type for CreateThingRequestBody and CreateThingResponseBody without redeclaring the type for Thing

My script goes through my schemas file by file, so I want Thing to only be generated when it gets to /schemas/entities/thing.schema.json

unreachableDefinitions should achieve this, but for some reason it only works when declareExternallyReferenced is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant