Skip to content

Conversation

AlexHolly
Copy link
Contributor

@AlexHolly AlexHolly commented Sep 10, 2020

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: apiteam@swagger.io 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 
@JamesMessinger
Copy link
Member

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).

@AlexHolly AlexHolly force-pushed the adds-more-details-on-missing-$ref branch from db18624 to 4d99717 Compare October 6, 2020 15:32
@AlexHolly
Copy link
Contributor Author

Done.

Copy link
Member

@P0lip P0lip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the TS definition, a minor test update would be cool.
We presumably already have some tests for MissingPointerError, thus adding an additional assertion should be sufficient, no need to write a new case.

@AlexHolly AlexHolly force-pushed the adds-more-details-on-missing-$ref branch 3 times, most recently from 6490c2a to 9e5ea37 Compare June 6, 2021 12:33
@AlexHolly AlexHolly force-pushed the adds-more-details-on-missing-$ref branch from 9e5ea37 to a4689b5 Compare June 6, 2021 12:35
@AlexHolly AlexHolly requested a review from P0lip June 6, 2021 12:37
@jonluca
Copy link
Collaborator

jonluca commented Feb 3, 2023

This PR looks good - apologies for the long delay here @AlexHolly

If you rebase this onto latest I'll merge it in.

# Conflicts: #	lib/index.d.ts #	lib/pointer.js #	lib/util/errors.js #	test/specs/missing-pointers/missing-pointers.spec.js
…ails-on-missing-$ref # Conflicts: #	test/specs/missing-pointers/error-details.yaml
@AlexHolly AlexHolly force-pushed the adds-more-details-on-missing-$ref branch from 571528a to 7308135 Compare February 4, 2023 19:59
@AlexHolly
Copy link
Contributor Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants