Search code examples
yamlopenapi

What's the difference between |, > and >- in OpenAPI YAML descriptions?


I'm looking at OpenAPI and the description tag. What are the differences between these tags? They all support multiple lines, but anything else?

description: |
description: >
description: >-

Solution

  • description isn't a YAML "tag", it's just a field/property in the YAML file you're editing, such as an OpenAPI or Swagger document.

    The YAML specification describes the different text folding styles here: https://yaml.org/spec/1.2/spec.html#id2793652

    That's pretty hard to understand at first glance, so this site makes things a lot easier, and has interactive examples: https://yaml-multiline.info/