-
Notifications
You must be signed in to change notification settings - Fork 339
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
Validation Process rethink, part 3 #1135
Comments
That makes it impossible to pass through the erroneous request in proxy mode, right?
This is actually a big question. Do we have plans to support other protocols? IMO it would be so cool to do support. |
Most likely we can still make it happen by returning a
I think we do, but when's this happening?
Let's think about it without committing to anything specific yet and we'll go from there. |
We could take a rough look at other protocols to know what we are dealing with. I have a feeling that we have gone too far with core being compatible with HTTP. That may answer the question of whether there is a good abstraction. |
Definitely more to ponder! |
I think the idea was to consider supporting other protocols such as those in AsyncAPI right, like MQTT or AMQP? If so, it's going to be wildly different. Let's keep focused on HTTP and we can consider what abstractions are necessary when we try to focus on those protocols, but for now it seems like a premature abstraction thats making it hard to maintain functionality for the one protocol we actually support. |
@philsturgeon You're on the wrong rail — this issue has nothing to do with supporting other protocol. To keep it short, at the moment we're parsing a part of the http request twice because we're losing the information along the chain of the request processing. The proposal here would modify the way we use Either to keep carrying such information — and reuse it when necessary. It's not a big deal at the moment, but it would better for sure |
Closing this issue out. We may address this in future, but will open up a new issue at that time. |
It turns out that validation is a very complicated part of Prism and, although we have reworked it several times we still haven't got that right.
With the recent change in the way the proxy works for invalid requests in case the
--errors
flag is provided, we can really likely extract the inputValidation parts from proxy and mock (they are now duplicated, with almost the same code) and make the inputValidation step return a realEither<NonEmptyArray<IPrismDiagnostic>,InputPart>
and halt the request processing there.It's a very good opportunity to make the code easier to read and simplify some things in Prism.
The only big problem I found while trying to tame this on my own is that the Core package does not allow for any manipulation of stuff because it's too generic. The benefits of having the core package is starting to be a little bit questionable now and it might make sense to break that and transfer all the code in prism-http directly.
The text was updated successfully, but these errors were encountered: