ErikWittern / openapi-snippet

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

Add Support for using example field in parameter to generate snippet … #61

Closed cmullenx closed 3 years ago

cmullenx commented 3 years ago

Currently headers found inside a given method's parameters only populate with an example value of "SOME_' + (param.type||param.schema.type).toUpperCase() + '_VALUE". This PR generates an example value for headers found in the parameter using some properties found in the parameter object. Additionally, this PR also uses the "example" property in the parameter object (if available) to generate an example value.

Refer to: https://github.com/ErikWittern/openapi-snippet/pull/57

ErikWittern commented 3 years ago

@cmullenx Thank you very much for adding tests!