Skip to content

A feature to have READ ONLY value fields on a model shown up in the swagger documentation #854

@stephenleny

Description

@stephenleny

As a user of swagger, I want to have a feature to have READ ONLY value fields on a model shown up in the swagger documentation.

I.e. We have this field "lastUpdatedDateTime" that is only a READ ONLY field on the model, but we still want this field to show in the swagger specification/ documentation

As recommended when using Jackson 1.9 and higher, to support this READ ONLY field on the model, we use:

  1. @JsonIgnore on the member variable and the setter method
  2. @JsonProperty on the getter method.
    which means ONLY ignore on deserialization. (http://jackson.codehaus.org/1.9.9/javadoc/org/codehaus/jackson/annotate/JsonIgnore.html)

So, we want Swagger to parse it for READ ONLY fields to still showing up in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions