Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers missing from documentation code examples when collection is generated from OpenAPI 3 schema #7914

Closed
jsooter opened this issue Jan 14, 2020 · 3 comments · Fixed by #9079

Comments

@jsooter
Copy link

jsooter commented Jan 14, 2020

Describe the bug
When a header is included as part of the securitySchemes in OpenAPI 3.0 it is correctly added to a collection generated from that schema. However, documentation generated from that collection does not include the header in code examples as it should.

Headers ARE included in documentation code examples for collections that are not generated from API schema.

To Reproduce
Steps to reproduce the behavior:

  1. Create an OpenAPI 3.0 schema and include a security scheme with the "type: apiKey", a name, and "in: header".
  2. Add the security scheme to the requests in the API schema
  3. Save the schema in Postman
  4. Generate a collection
  5. Verify that the header is part of the requests in the collection
  6. From the collection menu select "Publish docs"
  7. Preview the documentation and observe that the header is missing from the code examples/snippets

Expected behavior
When publishing documentation from a collection that is created in Postman and not generated from OpenAPI 3.0 schema the Header IS included in the code example/snippet

Screenshots
Documentation Example

App information (please complete the following information):

  • App Type: Native App
  • Postman Version: 7.15
  • OS: macOS Mojave 10.14.5
@abhijitkane
Copy link
Member

abhijitkane commented Aug 18, 2020

@raja @jsooter This is a bug with the OpenAPI -> Collection converter. The generated collection has the API Key header in the root request, but not in the example request. The latter is what's used to generate the code snippet.

We're picking this up on priority.

@VShingala
Copy link
Member

VShingala commented Sep 22, 2020

@jsooter We have added a new option Include auth info in example requests which will add header in example to corresponding to the security scheme.

Closing this issue for now, feel free to reopen this issue for any further problems.

@abhijitkane
Copy link
Member

This won't retroactively update collections, though. Previously imported OpenAPI docs will need to be reimported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants