-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
result field could be a JSON schema instead of custom contentDescriptorObject #231
Comments
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. |
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. |
@rmedaer Haven't forgot about this. Been thinking about ditching content descriptor for just plain json schema for both param and result. Scope of change would be quite large, but the more I think about it the more it makes sense. |
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. |
the separation we have with ContentDescriptors is better for code generation, and lines up with OpenAPI that we forked, having if we had just JSON Schemas for params, we'd have to have separate specs for params cant just be forced as only objects: |
Since this was mentioned, I'll talk about this in the context of result. With result it's much simpler, but I think there's still a lot of value add in having an explicit usage of a content descriptor ( name decoupled from type and no guesswork there). It will help with downstream consumers of the spec ( annotations code generation) , as well as make it easier for lib builders to handle one specific case contentDescriptors imho. |
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. |
As far as I read JSON RPC 2.0, 5. Response Object there is no rule or restriction for the result object. Indeed we can either put an
integer
, anobject
or any valid JSON (includingnull
).See in examples:
Currently in OpenRPC spec, we are waiting for a Content Descriptor Object. It doesn't define which kind of content it returns as Response result.
My proposal is quiet the same then issue #226: use a JSON Schema instead of Content Descriptor Object. Despite
params
field which only accept anobject
, anarray
ornull
, we can here put any valid JSON Schema.Example:
The text was updated successfully, but these errors were encountered: