question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Downloading / Publishing YAML removes quotes from strings

See original GitHub issue

When downloading or publishing an project api specification, we’re seeing previously quoted values being outputted without quotes.

This is in turn leading to a bug with the fields being incorrectly rendered in tooling such as redoc — which typically converts the YAML into a JSON object

A repeatable example can be seen over at https://onlineyamltools.com/convert-yaml-to-json using the following example payloads…

Quoted Date String

Priority Order request:
  value:
    order:
      courier_type: priority
      delivery_address: 1 Union Street
      delivery_postcode: "2009"
      delivery_state: NSW
      delivery_suburb: Pyrmont
      authority_to_leave: "Yes"
      delivery_date: "2016-07-26"
      delivery_window: 16:00-19:00
      parcel_attributes:
      - qty: 1
        weight: 2.1

— delivery_date results in displaying as “2016-07-26”

Unquoted Date String

Priority Order request:
  value:
    order:
      courier_type: priority
      delivery_address: 1 Union Street
      delivery_postcode: "2009"
      delivery_state: NSW
      delivery_suburb: Pyrmont
      authority_to_leave: "Yes"
      delivery_date: 2016-07-26
      delivery_window: 16:00-19:00
      parcel_attributes:
      - qty: 1
        weight: 2.1

— delivery_date results in displaying as “2016-07-26T00:00:00.000Z”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
EricWittmanncommented, Apr 20, 2021

@carlesarnal can you have a look at this?

1reaction
EricWittmanncommented, Apr 20, 2021

OK no worries. I’m going to transfer this issue over to the Registry GitHub repository for tracking there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML: Do I need quotes for strings in YAML? - Stack Overflow
the YAML cookbook says: Enclosing strings in double quotes allows you to use escaping to represent ASCII and Unicode characters. Does this mean...
Read more >
A YAML Primer — OctoPrint master documentation
Never use tabs outside of quoted strings, especially not for indentation. The tab character is illegal within YAML files. Whitespace and indentation matters...
Read more >
Strings in YAML - To Quote or not to Quote | tinita [blogs.perl.org]
The good news is, the YAML double quoted string works the same as in JSON, so if you know that already, you will...
Read more >
Saving with double quotes in YAML config for \n? - SpigotMC
By manually editing the config, I've tested that \n only works when the loaded string uses double quotes, as shown.
Read more >
10 YAML tips for people who hate YAML | Enable Sysadmin
Do you hate YAML? These tips might ease your pain. Posted: June 10, 2019 | 9 min read | by Seth Kenlon (Editorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found