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

Respect declareExternallyReferenced for non-interface types #534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexmojaki
Copy link

Fixes #525

Copy link
Owner

@bcherny bcherny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't quite work as expected, I think -- what happens in this case?:

export const input = {
  type: 'object',
  definitions: {
    a: {
      title: 'a',
      type: 'string'
    }
  },
  properties: {
    a: {
      $ref: '#/definitions/a',
    }
  },
}

Can you spec out how this should behave a bit better? As designed, I'd expect declareExternallyReferenced: false to still emit a declaration for A in this case, since A was declared locally.

We might want a way to pipe through whether a dereference was external or not. See resolver.ts.

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

Successfully merging this pull request may close these issues.

declareExternallyReferenced should be respected for non-interface types, too
2 participants