Skip to content

Schemas don't have the right order of key value pairs #536

Open
@Amit0617

Description

@Amit0617

I am working on some tooling over execution APIs where rendering of docs happening through Openapi schema.
I was taking transactions definition as defined in this repository.

There are some issues:

  • There is nothing like
    type: 'null'
    rather it should be
    nullable: true
  • title is defined before using $ref which results in local title to be replaced with title value inside $ref. So, to overwrite title value from $ref, it should be defined after $ref key.
  • Also neighbour items of $ref get ignored and they are required to be wrapped under allOf.
    Example
    -         nonce:
    -          title: nonce
    -          $ref: '#/components/schemas/uint'
    +         nonce:
    +          allOf:
    +           - $ref: "#/components/schemas/uint"
    +           - title: nonce

Following are comparisons of both rendered
Before: where local title values are coming from $ref component
2024-04-23-17-34-05

After: where desired title values are getting rendered
2024-04-23-17-45-17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions