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

Remove iron integration trait scope restriction #4111

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

sehnryr
Copy link
Contributor

@sehnryr sehnryr commented Oct 21, 2024

Remove private[iron] scope on ValidatorForPredicate, PrimitiveValidatorForPredicate and LowPriorityValidatorForPredicate traits to match with refined integration's.

Then, the documentation for iron's integration won't be misleading:

Similarly to `tapir-refined`, you can find the predicate logic in `integrations/iron/src/main/scala/sttp/iron/codec/iron/TapirCodecIron.scala` and provide your own given `ValidatorForPredicate[T, P]` in scope using `ValidatorForPredicate.fromPrimitiveValidator`

In the meantime, I use this workaround:
src/main/scala/sttp/tapir/codec/iron/expose/package.scala

package sttp.tapir.codec.iron.expose

export sttp.tapir.codec.iron.PrimitiveValidatorForPredicate
export sttp.tapir.codec.iron.ValidatorForPredicate

@sehnryr sehnryr changed the title change trait visibility to public Remove iron integration trait scope restriction Oct 21, 2024
@sehnryr sehnryr marked this pull request as ready for review October 21, 2024 18:29
@ahoy-jon
Copy link

@sehnryr thank you for the pull request! Straight to the source!

Just to make sure, can you add a test in https://github.com/softwaremill/tapir/blob/master/integrations/iron/src/test/scala-3/sttp/iron/codec/iron/TapirCodecIronTestScala3.scala ?

To check you can use custom constraint in Tapir?

@adamw
Copy link
Member

adamw commented Oct 23, 2024

Yeah it would be great to have a test :) Are you planning on adding one, or is this PR ready?

@sehnryr
Copy link
Contributor Author

sehnryr commented Oct 24, 2024

I don't know how to write such test, but I can look into it.

@adamw adamw merged commit 9b98cb7 into softwaremill:master Oct 24, 2024
26 checks passed
@adamw
Copy link
Member

adamw commented Oct 24, 2024

Thanks!

@sehnryr sehnryr deleted the fix/private-iron-integration branch October 24, 2024 16:29
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

Successfully merging this pull request may close these issues.

3 participants