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

description of readOnly is ambiguous and refers to property when it should be instance #1402

Open
DavidBiesack opened this issue Jan 25, 2023 · 6 comments · May be fixed by #1522
Open

description of readOnly is ambiguous and refers to property when it should be instance #1402

DavidBiesack opened this issue Jan 25, 2023 · 6 comments · May be fixed by #1522

Comments

@DavidBiesack
Copy link

The 2020-12 validation spec reads

attempts by an application to modify the value of this property
This should be changed to
attempts by an application to modify the value of this instance
since readOnly can apply to an object or array or primitive schema, not just properties on an object.

(I'd also like more clarity here when readOnly: true appears on a container instance - i.e. explicitly state whether this constraint does or does not extend to containers within the container. I believe it is local and only applies to the container)

@Julian
Copy link
Member

Julian commented Apr 26, 2023

(I haven't read the description here carefully to see if I agree, but this belongs on the spec repo regardless, so going to move this there).

@Julian Julian transferred this issue from json-schema-org/json-schema-org.github.io Apr 26, 2023
@gregsdennis
Copy link
Member

Since readOnly is merely an annotation, JSON Schema is intentionally non-prescriptive on what its meaning is. That is for the consuming application to decide.

If two applications are sharing a schema that contains readOnly, then they need to agree on its usage.

@jdesrosiers
Copy link
Member

@DavidBiesack I agree that this wording is awkward at best. The current wording makes it sound like the keyword is only allowed on schemas that describe properties, which is not true. I'd approve a PR with the proposed change.

(I'd also like more clarity here when readOnly: true appears on a container instance - i.e. explicitly state whether this constraint does or does not extend to containers within the container. I believe it is local and only applies to the container)

I've always thought of it as extending to the entire value. For example, you could put it at the root of your schema to indicate that the entire document is read only.

@gregsdennis gregsdennis added this to the stable-release milestone Jun 18, 2024
DavidBiesack added a commit to DavidBiesack/json-schema-spec that referenced this issue Jun 19, 2024
…ot just properties). Format `true` and `false` code values
@DavidBiesack
Copy link
Author

PR submitted

@DavidBiesack
Copy link
Author

The PR build failed though I don't know what that rule is, what it means, or how to correct it.

@gregsdennis
Copy link
Member

We have a two-week minimum open time for spec changes. That GH Action just keeps us from violating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting PR
4 participants