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

fix(resolvers): fix generating schema for alias object #382

Merged
merged 1 commit into from
May 10, 2022
Merged

fix(resolvers): fix generating schema for alias object #382

merged 1 commit into from
May 10, 2022

Conversation

bluebeel
Copy link
Contributor

@bluebeel bluebeel commented May 10, 2022

Status

READY

Description

resolveRef expect as input one of the following options:

{ '$ref': '#/components/schemas/Error' }
{ type: 'array', items: { '$ref': '#/components/schemas/Pet' } }
{
  type: 'object',
  required: [ 'id', 'name' ],
  properties: {
    '@id': { type: 'string', format: 'iri-reference' },
    id: { type: 'integer', format: 'int64' },
    name: { type: 'string' },
    tag: { type: 'string' },
    email: { type: 'string', format: 'email' },
    callingCode: { type: 'string', enum: [Array] },
    country: { type: 'string', enum: [Array] }
  }
}

But it's possible for a schema to reference another schema (alias)

{
  name: 'fileType',
  in: 'path',
  description: 'the file type of verifications Identity.',
  required: true,
  schema: { '$ref': '#/components/schemas/EIdentityFileType' }
}

in that case the resolver will crash since he doesn't manage to find the $ref.

@vercel
Copy link

vercel bot commented May 10, 2022

Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel.

@anymaniax first needs to authorize it.

@anymaniax
Copy link
Collaborator

Thanks 🎉

@anymaniax anymaniax merged commit 37a993b into orval-labs:master May 10, 2022
@bluebeel bluebeel deleted the fix/schema-alias branch May 10, 2022 13:05
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.

3 participants