Skip to content

FR: option to produce MergePatch types readme.com can consume #33

@blakew

Description

@blakew

Per readme.com support, they don't support type: null to clear field values. Instead, they require type: [null, "string"]

This ticket is a feature request to support this compound type in MergePatch where parameters can be cleared.

Example:

interfaces:
  Target:
     ...
     members:
       payload_map:
          required: false
          initializable: true
          mutable: true
          schema:
            type: object
            additionalProperties:
              type: string

Current output:

components:
  schemas:
    ...
    TargetMergePatch:
      type: object
      properties:
        payload_map:
          oneOf:
            - type: object
              additionalProperties:
                type: string
              description: Pass this value to overwrite the existing value.
              title: Overwrite
            - type: "null"       # unsupported by readme.com
              description: "Pass `null` to clear this field's existing value."
              title: Clear
      additionalProperties: false

Desired output:

components:
  schemas:
    ...
    TargetMergePatch:
      type: object
      properties:
        payload_map:
          oneOf:
            - type: object
              additionalProperties:
                type: string
              description: Pass this value to overwrite the existing value.
              title: Overwrite
            - type: [string, "null"]       # required by readme.com
              pattern: ^null$
              description: "Pass `null` to clear this field's existing value."
              title: Clear
      additionalProperties: false

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