studio icon indicating copy to clipboard operation
studio copied to clipboard

Date values don't need quotes

Open ccudennec-otto opened this issue 1 year ago • 1 comments

Describe the bug

My schema contains a string property with format "date":

       - type: "object"
          properties:
            appointmentDate:
              type: "string"
              format: "date"

The file also contains an example for this property:

examples:
- appointmentDate: 2015-07-20

If the value is not quoted, I can see the following error in the "Diagnostics" section of https://studio.asyncapi.com/

"appointmentDate" property must match format "date"

If I read the YAML specification correctly, the above value does not need quotes to be interpreted as a valid string.

How to Reproduce

Described above.

Expected behavior

I don't see an error if the value is not quoted.

For your information: I've also created an issue in the library that I use the generate the asyncapi.yaml to go around this: https://github.com/springwolf/springwolf-core/issues/820

But in general IMHO the core issue is that AsyncAPI Studio should not mark unquoted values as error.

ccudennec-otto avatar Jun 27 '24 07:06 ccudennec-otto

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

github-actions[bot] avatar Jun 27 '24 07:06 github-actions[bot]

hey @ccudennec-otto , i wanted to solve this issue but i am unable to find the designated file folder for the same . could you please guide for it?

kamal9580 avatar Jul 19 '24 07:07 kamal9580

Hi @kamal9580! Which link/file are you looking for? I've double checked the links in the description but they all seem to work. I did not attach an example file. Is that what you mean?

ccudennec-otto avatar Jul 29 '24 12:07 ccudennec-otto

Is this issue fixed by #1124 ?

ccudennec-otto avatar Jul 30 '24 06:07 ccudennec-otto

Validation of type date was fixed in both studio and studio-next.

image

aeworxet avatar Jul 30 '24 09:07 aeworxet

Great! I've just tested my example and it also works! 🥳 I'll close the issue. 🌻

ccudennec-otto avatar Jul 30 '24 11:07 ccudennec-otto