Skip to content

JSON Schema Definitions not workΒ #639

@conioX

Description

@conioX

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

"@fastify/swagger": "7.4.1",

Issue

Hi Guys, I add new schema with addSchema in my fastify like this :

{
  $id: 'http://foo/common.json',
  type: 'object',
  definitions: {
    foo: {
      $id: '#address',
      type: 'object',
      properties: {
        city: { type: 'string' }
      }
    }
  }
}

and used in my route schema

 schema: {
      body: {
        $ref: 'http://foo/common.json#/definitions/foo'
      }
    },

its work in fastify no error found, but error in swagger

Could not resolve reference: Could not resolve pointer: /definitions/def-0/definitions/foo ddoes not exist in document

and when i check /documentation/json there is no my definitions inside -> definitions -> def-0

and models only {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions