Zally reports violation of rule #110 for endpoints returning binary data
See original GitHub issueI have endpoint which returns file content as binary
"/reports/{report-id}":
get:
produces:
- application/pdf
responses:
'200':
description: Return report as a PDF file
schema:
type: file
Zally reports violation:
MUST – Response As JSON Object
Always Return JSON Objects As Top-Level Data Structures To Support Extensibility
Rule: https://zalando.github.io/restful-api-guidelines/#110
But in fact this is totally valid according to rule 168
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Zalando RESTful API and Event Guidelines
You may expose binary data. You must use a standard media type and data format, if applicable — see Rule 168. If no...
Read more >RFC 4960: Stream Control Transmission Protocol
In SCTP, it is used by an endpoint to validate the State Cookie information that is returned from the peer in the COOKIE...
Read more >Returning Individual Research Results to Participants
The return of aggregate research data or study-level results; ... Commonly reported concerns of participants include breaches of privacy and exposure to the ......
Read more >3:20-cv-03671-MGL Date Filed 11/24/20 Entry Number 23 ...
law ” and that a violation of the rules may trigger “enforcement through disciplinary proceedings”). As the South Carolina Rules note, ...
Read more >Stream Control Transmission Protocol RFC 4960
In SCTP, it is used by an endpoint to validate the State Cookie information that is returned from the peer in the COOKIE...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A media type is defined to have the following form:
As a consequence the actual regex must look like:
I propose to reverse this logic. Since we assume that JSON is default data type I think it makes sense to check for it by default. And skip this check only for those endpoints that both have content type specified and value of this content type doesn’t contain substring “json”. What do you think? @netme @tkrop @maxim-tschumak