ErikWittern / openapi-snippet

Generates code snippets for given Swagger / Open API documents
MIT License
116 stars 67 forks source link

Fix schema $ref issue #27

Closed pkuhanandan-wish closed 4 years ago

pkuhanandan-wish commented 4 years ago

Fix for issue: https://github.com/ErikWittern/swagger-snippet/issues/26


TypeError: Cannot read property 'toUpperCase' of undefined
    at getQueryStrings (/node_modules/swagger-snippet/swagger-to-har.js:154:62)
    at createHar (/node_modules/swagger-snippet/swagger-to-har.js:44:18)

for spec:

      parameters:
        - in: "query"
          name: "param_name"
          description: "param description."
          schema:
            $ref: "#/components/schemas/SomeComponent"
ErikWittern commented 4 years ago

@pkuhanandan-wish Thank you for the PR! Would you be willing to add a test case for this new behavior? I just want to make sure it does what we intend it to do, and that we don't (inadvertently) break the behavior in future changes.

ErikWittern commented 4 years ago

This PR is superseded by https://github.com/ErikWittern/openapi-snippet/pull/39

If there is something missing in #39, this can be reopened.