-
Notifications
You must be signed in to change notification settings - Fork 2
feat(ipa): Add IPA-130 Dynamic Content Fields #56
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||
| --- | ||||||||
| id: 130 | ||||||||
| state: experimental | ||||||||
| --- | ||||||||
|
|
||||||||
| # IPA-130: Dynamic Content Fields | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The challenge we've seen is that String fields were used instead of object (any) fields. This means the IPA als clarifying how we handle unstructured data — using objects rather than strings. Focusing on that in summary instead of what not to use (strings) might lead to more clarity |
||||||||
|
|
||||||||
| Resource properties sometimes hold a JSON value — configuration objects, | ||||||||
| filters, metadata, templated payloads. Modeling such a property as a string | ||||||||
| containing the serialized JSON pushes serialization concerns onto clients and | ||||||||
| invites round-trip drift, because servers routinely normalize the JSON | ||||||||
| (whitespace, key ordering, reformatting of nested structures). Declarative | ||||||||
| clients then interpret the representation-level difference as state drift. | ||||||||
|
|
||||||||
| ## Guidance | ||||||||
|
|
||||||||
| - Properties whose value is JSON **must** be modeled as a JSON object in | ||||||||
| requests and responses — never as a string holding the serialized form. | ||||||||
| - When the JSON has a well-defined schema, the API **must** model that schema in | ||||||||
| the resource definition. Clients, documentation, and tooling benefit from | ||||||||
| knowing the shape of the content. | ||||||||
| - When the JSON is genuinely dynamic (arbitrary client-provided keys and | ||||||||
| values), the property can be modeled as an object with dynamic keys. | ||||||||
|
Comment on lines
+22
to
+23
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark this as experimental or adopt? The proposed behavior is well established: if a resource returns JSON, it must not encode nested JSON as a string.