Swagger is suppose to support JsonView but I can't get it to work.
Here are my versions:
<dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.9.2</version>
        <exclusions>
            <exclusion>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-annotations</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-models</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>1.5.24</version>
    </dependency>
    <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-models</artifactId>
        <version>1.5.24</version>
    </dependency>
Here is my model:
@JsonView(View.WriteView.class)
    LocalDateTime serviceTime;
    String location;
    String serviceType;
    String assignee;
    String status;
Here is my controller:
@ApiOperation(value = "Create a new order")
@PostMapping("/orders")
@ResponseStatus(HttpStatus.CREATED)
@JsonView({View.WriteView.class})
public Order createOrder(@Valid @RequestBody @JsonView(View.WriteView.class) Order order) {
    return orderRepository.save(order);
}
Both input and output is not working. Here is my swagger UI:
Also I have verified that the code does work, calling the REST API only returns one field.


 
     
    