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

feat: add new rule to prefer single resources (#764) #785

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

tkrop
Copy link
Member

@tkrop tkrop commented Oct 25, 2023

This pull request adds a new single resource preference rule according to proposal defined in #764.

fixes #764.

Signed-off-by: tkrop <tronje.krop@zalando.de>
Copy link
Member

@SmilyOrg SmilyOrg left a comment

Choose a reason for hiding this comment

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

A few comments :)

@@ -32,6 +31,27 @@ As a consequence, a JSON payload must
* contain only {RFC-7493}#section-2.3[unique member names] (no duplicate
names).


[#252]
== {SHOULD} design single resource for reading and writing
Copy link
Member

Choose a reason for hiding this comment

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

Resource might be ambiguous here, how about schema? That seems to be what OpenAPI calls it and also where you'd usually define these (under components/schemas)

Suggested change
== {SHOULD} design single resource for reading and writing
== {SHOULD} design single schema for reading and writing

Copy link
Member Author

Choose a reason for hiding this comment

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

How about resource schema?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that also works!

chapters/json-guidelines.adoc Outdated Show resolved Hide resolved
chapters/json-guidelines.adoc Outdated Show resolved Hide resolved
@SmilyOrg
Copy link
Member

SmilyOrg commented Nov 1, 2023

👍

2 similar comments
@tkrop
Copy link
Member Author

tkrop commented Nov 1, 2023

👍

@ePaul
Copy link
Member

ePaul commented Nov 1, 2023

👍


**Note:** A resource with property marked `readOnly` in the API according to
the {json-schema-validation}#rfc.section.9.4[JSON schema validation] may be
ignored or rejected by a server. Both are in line with the idea behind <<#109,
Copy link
Member

@ktsypkina ktsypkina Nov 1, 2023

Choose a reason for hiding this comment

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

Suggested change
ignored or rejected by a server. Both are in line with the idea behind <<#109,
ignored or rejected by a server. Both are in line with the idea behind
<<#109, the compatibility guidance>>, however, we suggest to document when
rejecting to prevent client side surprises.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the reason. The line length is 79?

@tkrop tkrop merged commit 9fae627 into main Nov 1, 2023
1 check passed
@tkrop tkrop deleted the single-resource-rule branch November 1, 2023 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add guideline for common request/response schemas
4 participants