Skip to content

Converting YAML doc with date types to JSON creates invalid JSON doc #332

Closed

Description

@gregbair

Microsoft.OpenApi version 1.1.0 -

I'm pulling in a YAML OpenApi doc with the following property in a schema:

orderedOn:
    type: string
    description: The date the order was submitted.
    format: date
    readOnly: true
    example: "2018-01-23"

When using the serializer (doc.Serialize(ms, openApiVersion, format);, where ms is a MemoryStream, openApiVersion is OpenApiSpecVersion.OpenApi3_0, and format is OpenApiFormat.Json, the JSON output is:

"orderedOn": {
    "type": "string",
    "description": "The date the order was submitted.",
    "format": "date",
    "readOnly": true,
    "example": 2018-01-23T00:00:00.0000000-05:00
}

which is invalid JSON (the date is not properly quoted)

Activity

  1. PerthCharern commented on Oct 16, 2018

    @PerthCharern
    Contributor

    This is fixed in #322. We will release a patch version by next week.

  2. gregbair commented on Oct 16, 2018

    @gregbair
    Author

    Thank you, I'll close this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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