loopbackio / loopbackio/loopback-next

OpenAPI shema definition for models should exclude hidden properties by default

Open
#4,495 4 comments 3 reactions 1 assignee View on GitHub

@jannyHou is already working on this.

Since Jan 25, 2020.

feature OpenAPI
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

Hidden properties are automatically removed from the response data (model's toJSON() excludes the hidden properties), so it seems that the schema definition should also exclude these fields by default. Currently, one has to manually add these fields to the "exclude" option in getModelSchemaRef()

Current behavior: hidden properties are removed from response data but openapi schema definition lists hidden properties in the schema.

Expected behavior: hidden properties are removed from response data and openapi schema definition does not list hidden properties.

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.