-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove unneeded allOf usages #407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this easier to review and merge I think it should be split into three separate PRs
- update openapi version (this might require separate discussion)
- remove unneeded allOf usages
- correct example definitions / indentation fixes
Removing example values should only be done if those are set incorrectly, otherwise I would also be in favor of keeping them.
@nflaig @dapplion This PR now depends on #409 for the openapi upgrade. So we are left with what is required to remove the incorrect
Note that some |
types/primitive.yaml
Outdated
description: "The genesis_time configured for the beacon node, which is the unix time in seconds at which the Eth2.0 chain began." | ||
example: "1590832934" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should make sure to use same order of properties everywhere, or how did you determine if description vs example should be 2nd property? Looking at ExecutionOptimistic
below, the original order was swapped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no consistent ordering in general. But that's probably for a different PR.
That said, I would be in favor of the following:
type
or$ref
description
example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a few nits regarding consistent ordering of properties.
This fixes error examples when working on spec in dev mode (without bundling step)
description: 'A bit is set if a signature from the validator at the corresponding index in the subcommittee is present in the aggregate `signature`.' | ||
$ref: "../primitive.yaml#/Bitvector" | ||
example: "0xffffffffffffffffffffffffffffffff" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not follow ordering discussed in #407 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to keep the order unchanged in this PR (should be the case now) and have another one introducing a consistent order with associated CI and command to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, as discussed in #407 (comment), previous ordering is kept to keep changes as minimal as possible
This runs ok, are we ok to merge? |
@rolfyone fine with me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A number of
Schema
andResponse
$ref
s embeddescription
andexample
in a way that is not supported by the openapi spec (relying on an incorrectallOf
indirection).Starting with OpenAPI 3.1
description
can be overridden at the$ref
level.example
can be defined at theResponse
level, fixing most issues. Some others were duplicates or irrelevant.Note that some components were already leveraging this syntax, so this PR merely aligns on a single syntax. This also reduces the validation and error messages complexity.
I also validated that
example
still show up in the swagger UI after this change.requires #409