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

Exposing Validation Metadata #27

Open
brizzbuzz opened this issue May 26, 2021 · 3 comments
Open

Exposing Validation Metadata #27

brizzbuzz opened this issue May 26, 2021 · 3 comments

Comments

@brizzbuzz
Copy link

Hey, I am working on an OpenAPI spec generator for Ktor https://github.com/bkbnio/kompendium and would love to build in Konform validation, but I am running into a problem. A method for generating validation metadata is eluding me.

Because all implementations of Validation are internal, and afaik the actual constraints don't get exposed to the end user, it feels like I am in a bit of a bind as far as pulling that info goes.

So I have a couple questions

  1. Am I just missing something? Is there an easy way to pull constraint metadata for a declared validation
  2. If not, are there any major concerns with exposing the list of constraints applied to a validation?
@brizzbuzz
Copy link
Author

for visibility bkbnio/kompendium#61

@nlochschmidt
Copy link
Member

Nice project 👍🏻

Depending on what you would like to achieve exactly, just exposing the Constraints wouldn't help because the validation logic is not declarative but instead defined by lambdas.

In addition, while the built-in constraints are modelled after JSONSchema, the constraints used in practice can often not be described in terms of JSONSchema.

Maybe an alternative to look into for your project could be an integration with an actual JSONSchema validator.

@brizzbuzz
Copy link
Author

Nice project

Tyty it's been a fun build :)

exposing the Constraints wouldn't help because the validation logic is not declarative but instead defined by lambdas.

ahhhh I see, that makes sense... I'll need to think more on this then.

gonna close this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants