I want to have reference to other yaml file in my NodeJS project.
My main yaml file look like this
openapi: 3.0.3
info:
title: test
description: Description
version: 0.0.1
servers:
- url: http://localhost:3000
variables:
basePath:
default: /
description: Local server with default port
paths:
/sign-in:
post:
summary: Test.
description: Test.
requestBody:
$ref: "test.yaml"
responses:
'200':
$ref: "test.yaml"
test.yaml file look like this:
description: Optional description in
required: true
content:
application/json:
schema:
type: object
required:
- id
properties:
id:
type: string
And I'm getting error on my generated swagger documentation
For generating swagger i use https://www.npmjs.com/package/swagger-ui-express
My swagger-ui config:
app.use(OpenApiValidator.middleware({
apiSpec: 'schemas/openapi.yaml',
validateRequests: true,
validateResponses: true
}));
Using ./test.yaml instead of test.yaml didn't work
