ddymko / go-jsonerror

Small package which wraps error responses to follow jsonapi.org
MIT License
16 stars 2 forks source link

lowercase errors key in the json response #5

Closed kallusakar closed 5 years ago

kallusakar commented 5 years ago

Hi, thanks for the library, it works great but I was wondering if the "Errors" key in the response shouldn't be lowercase, as that is how json api spec is showing it - https://jsonapi.org/format/1.1/#error-objects

It would probably be a breaking change for existing projects so I'm writing it here first but I'd be happy to post a pull request fixing it.

Best Regard, Lukas.

ddymko commented 5 years ago

@kallusakar I am sorry for the long reply. I completely missed this...sorry about that. Errors is capitalized so it is an exported field in the struct. However, we should add a tag to be safe so the encoder always sets it to lower case.

Feel free to submit a pull request to address this issue!