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

Support for definitions in a separate file #7

Open
lauradP opened this issue May 3, 2020 · 0 comments
Open

Support for definitions in a separate file #7

lauradP opened this issue May 3, 2020 · 0 comments

Comments

@lauradP
Copy link

lauradP commented May 3, 2020

Hi,
nice component, congrats!

I'm trying to use it in order to document many apis. I'd like to keep some schema definitions (I'm using openapi 3.0) in a separate file but I get this error:
Resolver error at paths./Module/rest/export.get.parameters.0.schema.$ref
Could not resolve reference: Could not resolve pointer: /components/schemas/FileUri does not exist in document

My definition is:

openapi: 3.0.0
info:
  version: 1.0.8
  title: myModule
paths:
  /Module/rest/export:
    get:
      servers:
        - url: 'http://10.21.30.160:8080'
      parameters:
        - $ref: '#/components/parameters/metadata'
        - $ref: '#/components/parameters/media'
        - $ref: '#/components/parameters/parentId'
      responses:
        '200':
          description: the created ID
          content:
            text/plain:
              schema:
                $ref: '../common-definitions.yaml#/components/schemas/AssetId'
        '404':
          description: Not found
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '../common-definitions.yaml#/components/responses/Error'

common-definitions.yaml is in the same server (in the parent folder) and ic correctly fetched by the browser (checked in network panel).

components:
  schemas:
    AssetId:
      type: string
      pattern: '^[0-9]+'

Is there any mistake (in my definition)?

thanks,
Laura

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