Re:Everything old is new again: Microservices
by _asummers on Wednesday May 09, 2018 @08:51AM
(#17029371)
> It's far better than JSON schema anyway since you can enforce whatever custom validation you like.
IMO, the value of JSON Schema isn't that you have no validation that exists outside of JSON Schema, the value is that you can front load a TON of the validation into it, and share that vocabulary between your services. If you publish a JSON Schema about your endpoint, I can read that or feed it into tooling to produce a form to consume it. As someone working on the Elixir JSON Schema lib currently, the places where we COULDN'T express the validation with JSON Schema were often more interesting.
Re:Everything old is new again: Microservices
by scarface74 on Wednesday May 09, 2018 @08:25AM
(#17029253)
But it doesn't have to be discoverable. And if you do want it then you could write the documentation by hand or expose a simple REST index endpoint.
Like all documentation written by hand, it rapidly gets out of date with the actual implementation if you're not careful.
Also tools can automatically create proxy classes from WSDL's and now Swagger endpoints.
This is not necessary in many languages that centre around domain objects. The validation is done automatically when the JSON gets mapped back to the object. It's far better than JSON schema anyway since you can enforce whatever custom validation you like.
> Then they realized that they needed some method to make a REST Api discoverable
But it doesn't have to be discoverable. And if you do want it then you could write the documentation by hand or expose a simple REST index endpoint.
> Now we are right back to being as complicated as SOAP.
You chose to make it complicated though.