Skip to content

Support oneOf in schema definition #16

Description

@Szer

oneOf basically means union type
We could encode them with F# DUs

    paths:
      /pets:
        patch:
          requestBody:
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/Cat'
                    - $ref: '#/components/schemas/Dog'
          responses:
            '200':
              description: Updated
    components:
      schemas:
        Dog:
          ...
        Cat:
          ...

should generate

// usual generation of type objects
type Dog = ... 
type Cat = ... 

type CatOrDog = //generatedName
  | Cat of Cat
  | Dog of Dog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions