Skip to content
Advertisement

How do I document a Rest parameter providing another type (MyClass vs. String)?

In Springfox I once used the following syntax to render a String parameter with a full model (original Github issue):

JavaScript

The reason for this formulation is that if I put MyClass as type for the request body I had no way to distinguish when a property has not been updated or when has been set to null, because both would be deserialized to a null field value.

How do I do that with Springdoc?

Advertisement

Answer

This the equivalent code, using OpenAPI 3.

JavaScript

You can have a look at hte migration guide:

And the swagger documentation:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement