Redocly / Redocly/redoc

Empty objects with discriminator not showing expand button

Open
#1,680 1 comment 0 reactions 1 assignee View on GitHub

@AlexVarchuk is already working on this.

Since Jul 30, 2021.

investigation
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Suggestion to add a check whether the schema has a discriminator property to mark it as isPrimitive=false:
https://github.com/Redocly/redoc/blob/823be24b313c3a2445df7e0801a0cc79c20bacd1/src/utils/openapi.ts#L114

Test case

// MyAggregatingField.yaml
type: object
discriminator:
  propertyName: "someType"
  mapping:
    X: X.yaml
    Y: Y.yaml
// X.yaml
type: object
properties:
  someType:
    type: string
    default: "X"
  foo:
    type: string
// X.yaml
type: object
properties:
  someType:
    type: string
    default: "Y"
  bar:
    type: string

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.