ErikWittern / openapi-snippet

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

The method getHeadersArray doesn't follow $ref nodes #84

Closed michaelgwelch closed 2 years ago

michaelgwelch commented 2 years ago

The getHeadersArray when looking at the path object doesn't resolve $ref nodes.

https://github.com/ErikWittern/openapi-snippet/blob/2e6c2c91859c56442f134ced22ef609e7b4b36cd/openapi-to-har.js#L385-L395

This is an easy fix as this is already done for path parameters and query parameters. I have a fix for this in #82 which I'm still working on.

See these two snippets for examples:

parseParametersToQuery:

https://github.com/ErikWittern/openapi-snippet/blob/2e6c2c91859c56442f134ced22ef609e7b4b36cd/openapi-to-har.js#L255-L271

getFullPath:

https://github.com/ErikWittern/openapi-snippet/blob/2e6c2c91859c56442f134ced22ef609e7b4b36cd/openapi-to-har.js#L335-L357

michaelgwelch commented 2 years ago

Resolved in #86