Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

bundle removes quotes #89

Open
dwt opened this issue May 4, 2023 · 0 comments
Open

bundle removes quotes #89

dwt opened this issue May 4, 2023 · 0 comments

Comments

@dwt
Copy link

dwt commented May 4, 2023

Hi there,

I've got the problem that I have an openapi spec that looks like this (small excerpt):

something:
  example: "3914364093"
  type: string
something_else:
  example: "015711521886"
  type: string

These two look quite similar, but because of the leading 0, when combing the file that contains this yaml with the main openapi.yaml it gets converted to this:

something:
  example: '3914364093'
  type: string
something_else:
  example: 015711521886
  type: string

So a) the quotes get converted (I see nothing bad there) but b) for something_else the quotes around the example get removed.

The last one is quite bad, as that means that any yaml interpreter is free to interpret the example as a number instead of a string (even though that type is clearly stated in the next line).

Running this to redocly does exactly that, and the example gets rendered as an int (thus loosing the leading zero).

Workarounds: It seems that using the json output format instead doesn't strip the quotes, so that is something I'm going to try for the time being, but it's definitely something I would like to not do in the long run as yaml is much easier to read and also much closer to what we actually write.

What would I like?

  • Can you offer the reason why you remove quotes? It seems to me that this is a really bad idea / bug
  • Should you agree that it's a bug, could we stop dropping quotes?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant