-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
bugUnexpected behaviour for functionality that either was intended to work, or has worked in the pastUnexpected behaviour for functionality that either was intended to work, or has worked in the pastscalaBroadly concerning Scala code generation or the generated Scala codeBroadly concerning Scala code generation or the generated Scala code
Description
Given the following definition:
definitions:
Foo:
type: object
properties:
bar_baz:
type: string
x-scala-type: NonEmptyString
x-scala-empty-is-null: truex-scala-empty-is-null does not seem to do anything. Changing the spec to just be bar or just baz produces the expected behaviour (flatMapping on the parsed string value, sinking to null if empty).
I've traced this through and found if (emptyToNullKeys contains param.name) compares the normalized parameter name to the original parameter name. Suggestion is to replace this code with a boolean, as we're threading through the same value in two different fields, just to do an incorrect comparison at the end.
Metadata
Metadata
Assignees
Labels
bugUnexpected behaviour for functionality that either was intended to work, or has worked in the pastUnexpected behaviour for functionality that either was intended to work, or has worked in the pastscalaBroadly concerning Scala code generation or the generated Scala codeBroadly concerning Scala code generation or the generated Scala code