sbp commented on issue #287: URL: https://github.com/apache/tooling-trusted-releases/issues/287#issuecomment-3491525217
Quart Schema itself [has a mechanism for parsing HTML forms](https://quart-schema.readthedocs.io/en/latest/how_to_guides/request_validation.html#form-data): > If the request body is form (application/x-www-form-urlencoded) encoded the `source` argument can be changed to validate the form data But I don't suggest we use it, for two reasons. [Issue #93 with Quart Schema](https://github.com/pgjones/quart-schema/issues/93) means that we cannot use the code as is. The issue was opened on 11 Nov 2024, nearly a year ago, and hasn't received a single comment. I wrote a patch which makes it work for ATR, but my fix does not handle the many edge cases that would be necessary for upstreaming to Quart Schema. I've mentioned my basic design in the original issue. That the issue exists and has not been addressed for a year indicates that not many people are using Quart Schema for parsing HTML forms; it indicates that there may be other rough edges. Another problem with Quart Schema is its application model and error mode handling. You have to use it as a decorator, and it changes the argument structure, but we already do the same for our routes in ATR and this would create a complex interaction. I'm sure that this can be solved, but composing conflicting decorators in this way leads to complicated higher order programming with types that are difficult to understand and maintain. Moreover, errors must be handled at the Quart level, which means that our route handlers wouldn't get to see them. This would be fine if we could put all the logic in the Quart level error handler, but it's not clear how we would do that without making significant architectural changes anyway. Therefore I suggest that we make our own Quart to Pydantic adapter. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
