Skip to content
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

Permit customizing input validation responses #148

Open
sledorze opened this issue Dec 20, 2018 · 6 comments
Open

Permit customizing input validation responses #148

sledorze opened this issue Dec 20, 2018 · 6 comments
Labels
core Pertains to guardrail-core enhancement Functionality that has never existed in guardrail help wanted Easy to moderately difficult issues that don't require deep knowledge or architectural thought

Comments

@sledorze
Copy link

Is there already a solution to this?

@blast-hardcheese
Copy link
Member

Possibly, what kind of validation issues? Swagger syntax issues, or something else?

@sledorze
Copy link
Author

Sorry, I mean the server validation of the Json models the endpoint is receiving.

If I send a payload which does not correspond to the Swagger model, I would like to know what's wrong.
May I lack some insight on how to retrieve that from the server implementation (using akka-http) but wondering if something implementation agnostic exists.

@blast-hardcheese
Copy link
Member

Ah, this currently doesn't exist; I'm thinking it may be how we're doing the content validation exception, failing over to other available unmarshallers.

What kind of message would you expect to see? I'm assuming a Circe path would not be the best user experience; possibly a JSON path?

@sledorze
Copy link
Author

@blast-hardcheese anything that actually provide an hint and supports custom validation messages.
I'm not sure about what looks like a circe-path or JSON path yet.. (I've left Scala since 2012 and am just back to it, landing in the ecosystem - looking at it ATM)

@sledorze
Copy link
Author

@blast-hardcheese ok, I understand the problem now with circe-path.
I'm not sure but I guess the JSON Path would be extracted from the circe-path so this means we can have some way to handle directly a circe-path and possibly use a transformer to get a JSON path.
Exposing the circe DecodingFailure would be a good and the minimal, necessary first step.

@blast-hardcheese
Copy link
Member

@sledorze I agree; I've made these changes in the akka-http generator for now.

@blast-hardcheese blast-hardcheese changed the title Document how to see validation issues while in development Permit customizing input validation responses Jan 13, 2019
@blast-hardcheese blast-hardcheese added core Pertains to guardrail-core enhancement Functionality that has never existed in guardrail help wanted Easy to moderately difficult issues that don't require deep knowledge or architectural thought labels Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Pertains to guardrail-core enhancement Functionality that has never existed in guardrail help wanted Easy to moderately difficult issues that don't require deep knowledge or architectural thought
Projects
None yet
Development

No branches or pull requests

2 participants