nats-io / nats-architecture-and-design

Architecture and Design Docs
Apache License 2.0
177 stars 20 forks source link

Update Service API service and endpoint schema definitions #188

Closed piotrpio closed 1 year ago

piotrpio commented 1 year ago

This PR contains changes to how Service API handles schema definitions. Instead of one global Schema on Config, now there are:

ripienaar commented 1 year ago

ime its nearly impossible to extract per action schemas out thats actually useful, so I would use the url most often, though might have been nice to be able to return a service specific open api schema that covers the whole thing without needing a url.

though it would also be nice if a url could be like kv://registry/service.v1 to get it out of kv

piotrpio commented 1 year ago

@ripienaar We were thinking about aggregating per-endpoint schemas to form a complete schema, but also give possibility to add a service-scoped schema URL (though I agree, url to KV would be nice). The way it is proposed now would enable to easily parse all endpoint schemas into some target format, because when you call SCHEMA, you get all you want - endpoint names, subjects and request/response schemas.

ripienaar commented 1 year ago

Yeah what’s there now seems fine.

Personally I would just use the top schema feature since as I am sure you know breaking even the most basic OpenAPI or Proto spec into somethings that describes a single function that then results in a valid OpenAPI or proto spec is extremely difficult given the general quality of these libs

But no harm in supporting oer endpoint specs for those who can use tbem as long as the top level one is fully capable