json-schema-ref-parser
json-schema-ref-parser copied to clipboard
add more details on missing $ref
Example Current infos: https://apitools.dev/swagger-parser/online/
openapi: 3.0.2
info:
description: >-
This is a sample server Petstore server.
version: 1.0.0
title: Swagger Petstore
termsOfService: 'http://swagger.io/terms/'
contact:
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
/pet:
post:
tags:
- pet
parameters:
- $ref: '#/components/parameters/ThisIsMissing'
components:
parameters:
petId:
name: petId
in: path
required: true
schema:
type: integer
format: int64
PR will give this data
$ref value of: #/paths/~1pet/post/parameters/0
is missing target: #/components/parameters/ThisIsMissing
found: #/components/parameters
Hi @AlexHolly. Thank you for the PR. It looks like that code should probably go inside the MissingPointerError class instead (with additional data passed as parameters to the constructor).
Done.
This PR looks good - apologies for the long delay here @AlexHolly
If you rebase this onto latest I'll merge it in.
@jonluca I am unable to test it with https://github.com/APIDevTools/swagger-parser looks like it expects .js files. Is there a command to build them?