swagger-api / swagger-api/swagger-ui

Date object support with @ApiModelProperty

Open
#5,099 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: question
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

We are using apimodelproperty with our domain object like below,

class DateClass{
@ApiModelProperty(example = "2019-12-24")
private LocalDate checkIn;
@ApiModelProperty(example = "2019-12-25")
private LocalDate checkOut;
}

Instead of giving some random date here, I want checkIn as today date and checkOut as one day ahead of checkIn date.

Any way to achieve this? Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report mentions @ApiModelProperty, LocalDate, and the checkIn and checkOut fields, but no Swagger UI file or test. Start by determining whether dynamic date-based examples are supported for this API model annotation; done means establishing whether today and the following day can be represented and documenting the answer.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.