LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

allow override of error responses if required. #38

Closed davinchia closed 4 years ago

davinchia commented 4 years ago

reslang currently generates a single error struct as a response. although this is inline with our standards, there are edge cases where it does make sense to return an array of error structs.

see https://liveramp.slack.com/archives/CPBAEKS9X/p1585695908024700 for more detail.

liveandrew commented 4 years ago

verified in build 227b5fb2a66630b52e2c8eee1ea283353177e20d that error overrides are indeed possible. however, you have to specify arrays with an enclosing struct. this is to conform to json rules where an array can't be a top level structure for a valid json doc.

e.g. resource Foo { .... /operations GET 404 SpecialError }

structure SpecialError { description: string errors: StandardError[] }