Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Handle invalid security scheme components #208

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

kylef
Copy link
Member

@kylef kylef commented Apr 2, 2019

The parser is currently crashing for certain inputs, for example:

openapi: 3.0.0
info:
  title: abc
  version: xyz
paths: {}
components:
  securitySchemes:
    Foo: {}
TypeError: Cannot read property 'meta' of undefined
    at object.forEach (/Users/kyle/Projects/apiaryio/api-elements.js/packages/fury-adapter-oas3-parser/lib/parser/oas/parseComponentsObject.js:154:17)
    at content.forEach.item (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/minim/lib/primitives/ObjectElement.js:203:63)
    at Array.forEach (<anonymous>)
    at ObjectElement.forEach (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/minim/lib/primitives/ObjectElement.js:203:25)
    at pipeParseResult (/Users/kyle/Projects/apiaryio/api-elements.js/packages/fury-adapter-oas3-parser/lib/parser/oas/parseComponentsObject.js:152:14)
    at run (/Users/kyle/Projects/apiaryio/api-elements.js/packages/fury-adapter-oas3-parser/lib/pipeParseResult.js:60:25)
    at XWrap.f (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/ramda/src/reduceWhile.js:40:27)
    at XWrap.@@transducer/step (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/ramda/src/internal/_xwrap.js:12:17)
    at _arrayReduce (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/ramda/src/internal/_reduce.js:11:34)
    at _reduce (/Users/kyle/Projects/apiaryio/api-elements.js/node_modules/ramda/src/internal/_reduce.js:45:12)

@kylef kylef added bug Something isn't working openapi3 labels Apr 2, 2019
@kylef kylef requested a review from pksunkara April 2, 2019 14:35
@kylef kylef force-pushed the kylef/oas3-invalid-schemes branch from b1ddf0a to 5bf3518 Compare April 3, 2019 08:31
@pksunkara pksunkara merged commit 248f0f2 into master Apr 3, 2019
@pksunkara pksunkara deleted the kylef/oas3-invalid-schemes branch April 3, 2019 12:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working openapi3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants