Closed shaluksoftint closed 6 months ago
Hello @shaluksoftint , thanks for reaching out!
I am not able to reproduce the issue you described. For me, the value for date1 (date1: '2023-12-04'
) is displayed as expected in the Developer Portal definition and the downloaded definition.
Developer Portal doesn't change the uploaded definition from Azure portal. Could you please check if, after importing this API in Azure Portal, the schema is shown correctly in the editor? You can check this from Azure Portal, after importing the API: select the API -> OpenAPI editor
And if it the date is ok here, can you please let us know whether the issue still persist in Developer Portal?
Hello malincrist,
The issue can be reproduced only after publishing
the API. I am using Azure DevOps to publish the API.
Thanks for getting back to me.
Looking forward to hearing back from you again.
Even after publishing, I still get the initial string ("2023-12-04"
, without the default time) in both developer portal and the downloaded definition.
Could you please try importing this API again and check whether it still happens?
This issue is related to managed developer portal. We advise you to create a Azure support request to get assistance on this issue. Please refer to the below link to create a new Azure support request, Please select Problem Type = "Developer Portal" in the request to route it appropriately.
This issue is related to managed developer portal. We advise you to create a Azure support request to get assistance on this issue. Please refer to the below link to create a new Azure support request, Please select Problem Type = "Developer Portal" in the request to route it appropriately.
Bug description
When an API is published with a
date
field oftype: string
andformat: date
, developer portal and the exported yaml file display incorrect values in the examples payload for the date field.Reproduction steps
product.yaml
file:paths: /: post: requestBody: description: My request payload content: application/json: schema: $ref: '#/components/schemas/ProductPayload' examples: Example 1: value: id: 1 name: My Name date1: '2023-12-04' responses: "200": description: OK response content: application/json: schema: $ref: "#/components/schemas/ProductPayload" examples: Example 1: value: id: 1 name: My Name date1: '2023-12-04'
components: schemas: ProductPayload: description: Product Payload type: object properties: id: type: integer name: type: string date1: type: string format: date
{ "id": 1, "name": "My Name", "date1": "2023-12-04T01:00:00Z" }
openapi: "3.0.1" info: title: Product version: "1.0"
paths: /: post: requestBody: description: My request payload content: application/json: schema: $ref: '#/components/schemas/ProductPayload' examples: Example 1: value: id: 1 name: My Name date1: '2023-12-04T01:00:00.0000000+00:00' responses: "200": description: OK response content: application/json: schema: $ref: "#/components/schemas/ProductPayload" examples: Example 1: value: id: 1 name: My Name date1: '2023-12-04T01:00:00.0000000+00:00'
components: schemas: ProductPayload: description: Product Payload type: object properties: id: type: integer name: type: string date1: type: string format: date
{ "id": 1, "name": "My Name", "date1": "2023-12-04" }
Example 1: value: id: 1 name: My Name date1: '2023-12-04'