-
Notifications
You must be signed in to change notification settings - Fork 15
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
Protobuf oneOf to generate coproducts without Option-ality #113
Comments
SemanticBeeng
changed the title
Protobuf oneOf to generate coproducts and coproducts of Option
Protobuf oneOf to generate coproducts and not coproducts of Option
Jul 15, 2019
SemanticBeeng
changed the title
Protobuf oneOf to generate coproducts and not coproducts of Option
Protobuf oneOf to generate coproducts without Option-ality
Jul 15, 2019
The right protobuff syntax would be
and AFAIK skeuomorph will generate the |
I agree that optional values in Coproducts is redundant and doesn't make sense. We might want to keep this: case ProtobufF.TNamedType(name) => TOption(A.algebra(TNamedType(name))) but maybe we should just optimize the printer for Coproducts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
proto3
there is norequired
constraint available.As a consequence this
generates
Proposing the
Option
-ality is removed to generateshapeless
A :+: B :+: CNil
instead.Rationale:
Option
-ality seems redundant in the coproduct for evident reasons: if A is present in thecoproduct
then it is not optional.Given that
skeuomorph
is schema transformation library the user should have more flexibility at the time use frommu
(time of service api design) and not be bound by the semantics of source IDL (context #91).Resources
The text was updated successfully, but these errors were encountered: