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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions specification/resources/billing/responses/invoice_pdf.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
description: >-
description: >-
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

content-disposition:
$ref: '../../../shared/headers.yml#/content-disposition'
ratelimit-limit:
Expand All @@ -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

schema:
type: string
format: binary
format: binary