-
Notifications
You must be signed in to change notification settings - Fork 422
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
[BUG] Enumeration schema is inconsistent depending on the encoding function #3900
Comments
Hm it seems that this should work, being encoded to json here: and converted to a validator here: tapir/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/TSchemaToASchema.scala Line 150 in f93ed86
But clearly something doesn't work. Would need debugging :) |
@adamw the problem is that with the default When using |
Ah right ... so we would need special comparison logic for example values, which mirrors what |
Tapir version: 1.10.10
Scala version: 2.13/3.3.3
I am deriving
apispec.Schema
fromtapir.Schema
for an enumeration and found that the defaultencode
function produces inconsistentapispec.Schema
s. Such inconsistency is exposed whenapispec.Schema
is encoded and decoded to/form json.This problem is highlighted with the following code
Given following sealed trait
with helper methods
Then the following works correctly and assertion passes
But when using
derivedEnumeration
with the defaultencode
function, the following code failsThe text was updated successfully, but these errors were encountered: