ethereum / ethereum/execution-apis

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

Open
#536 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Io
Stars
1.1k
Forks
530
Avg merge
5d 8h
Merged PRs (30d)
9

Description

I am working on some tooling over execution APIs where rendering of docs happening through Openapi schema.
I was taking [transactions definition](https://github.com/ethereum/execution-apis/blob/main/src/schemas/transaction.yaml) as defined in this repository.

There are some issues:
* There is nothing like
```yaml
type: 'null'
```
rather it should be
```yaml
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
```diff
- 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](https://github.com/ethereum/execution-apis/assets/71893015/5d43dff2-3d23-4dcf-bea1-c19a9280e000)

After: where desired title values are getting rendered
![2024-04-23-17-45-17](https://github.com/ethereum/execution-apis/assets/71893015/73184783-3a83-4080-9699-d5bf41b7a8b5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.