HathorNetwork / hathor-core

Hathor core is the official and reference client for operating a full node in Hathor Network.
https://hathor.network
Apache License 2.0
83 stars 26 forks source link

Parse and validate API parameters from OpenAPI #56

Open obiyankenobi opened 4 years ago

obiyankenobi commented 4 years ago

From this comment. @msbrogli suggested:

"Instead of manually validating each input, isn't it easier to get the basic validation rules from the OpenAPI Specification of each API?

I'd say we would be able to validate 99% of the input errors using it, and it would also return the parsed object. Maybe we should have a ParsedQuery object with the types so mypy can check the types as well."

jansegre commented 2 months ago

This still makes sense. At the very least we could have automated tests the OpenAPI definitions against the API implementation.