OpenAPITools / OpenAPITools/openapi-generator
[BUG] [CSHARP-NETCORE] format: date is not serialised into OpenAPI full-date format, includes unexpected timestamp.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
Description
When generating the client from csharp-netcore template and the parameter is of type: string, format: date it should serialize into the full-date format (https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) : YYYY-MM-DD
At present the template serializes as: YYYY-MM-DDTHH:mm:ss.zzz (date with timestamp)
openapi-generator version
5.3.1 csharp-netcore template
OpenAPI declaration file content or URL
A minimal example of the section of OpenAPI that would generate this:
- in: query
name: start
required: false
schema:
type: string
example: "2018-09-17"
format: date
Related issues/PRs
Similar issue in a different library https://github.com/RicoSuter/NSwag/issues/1211
Suggest a fix
- Serialize
type: string,format: dateinto the correct API standard defined byfull-date
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by generating a client with the csharp-netcore template from the minimal OpenAPI declaration in the issue, then trace serialization for an optional query parameter with type string and format date. Look for the template's date handling and any related generator tests. Done means the generated client sends the value as YYYY-MM-DD without a timestamp.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100