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

billing/pdf: add content type header #697

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bentranter
Copy link
Member

The response for /v2/customers/my/invoices/{uuid}/pdf contains a content-type header in the response, so we should include that in the spec.

The response for `/v2/customers/my/invoices/{uuid}/pdf` contains a
`content-type` header in the response, so we should include that in the
spec.
@bentranter bentranter requested a review from a team July 25, 2022 18:15
Copy link
Contributor

@scotchneat scotchneat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this will have the intended effect.
If you run make preview with this change, it shows up like this:

image

@@ -12,7 +14,7 @@ headers:
$ref: '../../../shared/headers.yml#/ratelimit-reset'

content:
application/pdf:
application/pdf:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this is how the content type was determined but, you're right, the content-type isn't added to the rendered docs without it being set in the headers.

Copy link
Member

@andrewsomething andrewsomething Jul 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's shown here, but doesn't document that the header is actually included:

image

The response will be a PDF file.

headers:
content-type:
$ref: '../../../shared/headers.yml#/content-type'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this ref defines the content-type as application/json

https://github.com/digitalocean/openapi/blob/main/specification/shared/headers.yml#L51

You might need to add a new schema for pdf content type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya... It's the "example." It's really just documenting that the header is returned, not what it's content type is. Looks like we have the same problem with the content-disposition header example as well. It uses csv

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

Successfully merging this pull request may close these issues.

3 participants