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

bundle removes quotes #89

Open
Open
@dwt

Description

@dwt

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions