open-rpc / spec

The OpenRPC specification
https://spec.open-rpc.org
Apache License 2.0
167 stars 49 forks source link

question: content descriptor Examples field #315

Closed meowsbits closed 3 years ago

meowsbits commented 3 years ago

https://spec.open-rpc.org/#example-object says:

The Example object is an object the defines an example that is intended to match a given Content Descriptor Schema. If the Content Descriptor Schema includes examples, the value from this [note the emphasis] Example Object supercedes the value of the schema example.

I am confused: which Example Object supersedes the value of the ContentDescriptor.Schema.Example[s]? Where is Example Object supposed to be used?


(... and

... supercedes the value of the schema example.

should be "... schema examples", right? (https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5))


image

[...]

image

BelfordZ commented 3 years ago

I will agree that it is very unnecessarily complicated language to say an otherwise simple thing. If ever there is a schema.examples - you can ignore it. (yes, missing an s there, you right you right).

Since the open-rpc ExampleObject is not the same in structure as the JSON Schema Examples field, they are not interchangable, and so even mentioning anything around precendence of example here I think is not required.

Okay scratch everything I just said. I just remembered - we ditched contentDescriptor.example(s) a long time ago - back when we added examplePairings instead.

ExampleObjects can be reffed by components, but yeah this whole section needs reworking.

BelfordZ commented 3 years ago

todo: remove any reference to exampleobjects having ever been on contentDescriptor ;)

BelfordZ commented 3 years ago

@meowsbits would you like to take a stab at a PR for it? happy to take it from here otherwise!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

meowsbits commented 3 years ago

I believe this was resolved with #316.