ErikWittern / openapi-snippet

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

add support for using the parameter.example property to generate the … #57

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.

ErikWittern commented 3 years ago

@cmullenx Thank you for the PR! I just published a new version 0.9.3 with some vulnerability fixes. Would you be willing to rebase your PR? Also, it would be great if you could add a test demonstrating the new behavior (and also helping in keeping it working correct as the code changes in the future). Would you be up for that?

cmullenx commented 3 years ago

@cmullenx Thank you for the PR! I just published a new version 0.9.3 with some vulnerability fixes. Would you be willing to rebase your PR? Also, it would be great if you could add a test demonstrating the new behavior (and also helping in keeping it working correct as the code changes in the future). Would you be up for that?

Yes, I had a rebase fail. I will close this PR and open up a new one with the changes + tests.