I\'ve spent a bunch of time trying to find a solution for creating swagger docs in Node.JS. The main library is swagger-node, in which you create a swagger yaml file and the
Just as a hint, because I stumpled upon this: When I added
type: string
nullable: true`
as described in the answer https://stackoverflow.com/a/42797352/2750563 my service returned only "fieldName": { "present": true } instead of an actual value!
If you see this, simply add the JsonNullableModule to your Jackson serializer, for example, if using Spring:
@Component
public class JacksonConfiguration {
@Autowired
public void configureJackson(ObjectMapper mapper) {
mapper.registerModule(new JsonNullableModule());
}
}
Then everything looks fine again.