Skip to content

Hyper-schema: Add "deprecated" keyword #173

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions hyper-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
"type": "array",
"items": {"$ref": "#/definitions/linkDescription"}
},
"deprecated": {
"type": "boolean"
},
"readOnly": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should have "default": false

"type": "boolean"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Should have "default": false

"media": {
"type": "object",
"properties": {
Expand Down
10 changes: 10 additions & 0 deletions jsonschema-hyperschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@
</section>
</section>

<section title="deprecated">
<t>
If it has a value of boolean true, this keyword indicates that the value of the instance is deprecated, and intended for reverse compatability or internal use only, and may become missing in the future.
Copy link
Contributor

Choose a reason for hiding this comment

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

"value of the instance is deprecated" is strange phrasing. Usually you deprecate a field, not a field's value, or you deprecate an entire resource. So this could apply to any schema with a "self" link (which is basically what determines that the schema represents a resource), or to a field within an object schema. Or perhaps a position in a tuple schema (when "items" is an array of schemas).

There's something a bit strange there where this is either about a resource or about the context in which the schema appears (the property name or pattern, for instance).

Copy link
Member Author

Choose a reason for hiding this comment

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

It is, isn't it, I'll fix that

Copy link
Contributor

Choose a reason for hiding this comment

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

So how does this work?

In a root schema with a "self" link is means that the resource itself is deprecated? But it's still there currently?

In a root schema without a "self" link it means....?

In a property subschema (in any of the property keywords) it means that all matching properties are deprecated but will still be present?

In a schema applying to a single position in an array/tuple ("items" is an array) it means...?

In a schema applying to multiple array positions ("items" as one schema, or "additionalItems") it means...?

In the schema for "schema" or "targetSchema" it means...?

This concept is not ready for a PR. There are far too many cases that need discussing and a coherent view of hypermedia resources that need to be developed before we can just toss this in.

</t>
<t>
The value of this keyword MUST be a boolean.
The default value is false.
</t>
</section>

<section title="readOnly">
<t>
If it has a value of boolean true, this keyword indicates that the value of the instance is managed exclusively by the server or the owning authority, and attempts by a user agent to modify the value of this property are expected to be ignored or rejected by a server.
Expand Down