You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I hit the endpoint the response is: {"items":[{"stringField":"Hooray"},{},{"sortable":false,"stringField":"Boo"}]}
I was expecting the "sortable": true to be included in the serialized objects, which was the behaviour in 0.17.8 (maybe an intentional change in v0.18.0, but I couldn't find a mention of it in the change logs). If I set @required on the sortable field it will serialize the default properly.
The text was updated successfully, but these errors were encountered:
The behaviour is indeed working as intended now: non-required fields are skipped during serialisation when they have the default value.
We ought to document the expected behaviour better, but I'm making the decision to close this issue.
That being said, thank you very much for the detailed issue, it is very much appreciated and I would love it if every issue opened by users was written with a similar level of attention.
Hey, I'm not sure if this is intended behaviour or not, but it was unexpected from my end.
It seems that when I return a default value for a non-required field it is being omitted from the generated JSON, e.g. for this example:
MyService .smithy
build.sbt
Dependencies.scala
Main.scala
When I hit the endpoint the response is:
{"items":[{"stringField":"Hooray"},{},{"sortable":false,"stringField":"Boo"}]}
I was expecting the
"sortable": true
to be included in the serialized objects, which was the behaviour in 0.17.8 (maybe an intentional change in v0.18.0, but I couldn't find a mention of it in the change logs). If I set @required on the sortable field it will serialize the default properly.The text was updated successfully, but these errors were encountered: