Skip to content

Review on supporting schema shortened #5550

@climba03003

Description

@climba03003

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Schema shortened is a useful feature when the user can provide schema properties only.
But times go by, we support more and more variation in the route schema and I think that it is the time to say goodbye to the shortened schema.

I also believe most people are using tools to generate schema which is always full schema.
So, the impact should be minimal.

The main benefits would be

  1. Simplify the code-base
  2. No more quirk on the schema, currently onRoute is receiving the user defined schema but after ready it will be normalized.
  3. Plugins creator can be more strict forward to handle the schema.

We should discussion in supporting the shortened schema in 2 aspect.

  1. Headers and Querystring
    Both of them is always key-value pairs, having shortened schema is good to have feature and do not have any confusion.
  2. Body and Response
    Both of them may vary based on Content-Type. And after feat: support different body schema per content type #5545, both support schema based on Content-Type.
    I hope we would move towards OpenAPI standard and support only full schema (default to "application/json") and Content-Type with schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIssues or PRs with this label will never stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions