Skip to content

[BUG] output transformers strips out fields with anyOf schema #104

@celleb

Description

@celleb

Describe the bug
Properties with anyOf schema are striped out from output transformers.

Given the following schemas:
user/model.yml

anyOf:
  - $ref: ./driver/model.yml
  - $ref: ./passenger/model.yml
discriminator:
  propertyName: type
type: object
properties:
  token:
    type: string
    readOnly: true
    example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ5Y3BCVzRKSU0zYWVE...
  user:
    $ref: user/model.yml
required:
  - user
  - token

Produces

export default {
  // authorize
  authorize: {
    token: String
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Generate the backend from the swagger file
  2. Inspect the generated output transformer

Expected behavior
The transformer has the correct fields and types or at least allows any field to pass.

Node & NPM version
Node: 12.18.2
NPM: 6.14.8

Operating system:

  • OS: MacOS
  • Version: 11.2.2

Additional context
Using OAS3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions