Skip to content
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

OpenAPI - GetEthV1ValidatorBlocksWithSlot declared twice #3707

Closed
xrn opened this issue Mar 9, 2021 · 4 comments
Closed

OpenAPI - GetEthV1ValidatorBlocksWithSlot declared twice #3707

xrn opened this issue Mar 9, 2021 · 4 comments
Assignees
Labels
bug 🐞 Something isn't working

Comments

@xrn
Copy link

xrn commented Mar 9, 2021

From Go when I am using

openapi-generator generate --skip-validate-spec -i https://consensys.github.io/teku/latest.json -g go -c ./clients/teku/openapi_config.json -o ./clients/teku/tekuapi

I am getting two files api_validator_required_api.go and api_validator_api.go both are implementing same items - for example

// GetEthV1ValidatorBlocksWithSlotOpts Optional parameters for the method 'GetEthV1ValidatorBlocksWithSlot'
type GetEthV1ValidatorBlocksWithSlotOpts struct {
	Graffiti optional.String
}

I think it should be kept with one of them or moved to a separate file

@rolfyone rolfyone added the bug 🐞 Something isn't working label Mar 9, 2021
@rolfyone rolfyone self-assigned this Mar 9, 2021
@rolfyone
Copy link
Contributor

rolfyone commented Mar 9, 2021

thanks for raising this one, I'll have a look.

@rolfyone
Copy link
Contributor

So it looks like api_validator_required_api.go is an export of the 'Validator Required Api' heading, and api_validator_api.go is the 'Validator Api' heading.

They do come down to 1 implementation, but its got 2 category headings, which is pretty normal in OpenApi.

I would probably suggest only importing the api_validator_api.go, as its a superset of the required api. Some of the other parts of the required api live in the beacon group, so you might want to make use of those from that area also.

The standard api is written by hand into yaml, so you may be able to make use of that, which will probably come out cleaner because of the way it's been written. https://ethereum.github.io/eth2.0-APIs/

It does appear that there's projects mentioning similar to this issue, and they come down to requiring a swagger change.
OpenAPITools/openapi-generator#2701

I've upgraded swagger, javalin on our end, but it didn't stop the reported problem, so I'll hold off from any merge for that change.

Hopefully there's bits of this that are of use, but currently there appears to be not a lot we can actually do to help rectify this issue on our end.

@xrn
Copy link
Author

xrn commented Mar 10, 2021

Thanks, @rolfyone for the deep explanation. Everything clear - from my side we can close this issue if you would like to keep it as a reference feel free

@rolfyone
Copy link
Contributor

It's still accessible once closed, so I'll close it out. Glad that my explanation was helpful, but I was still really hoping to be able to actually make it work for you in preference to explain the complications.

If you do use the standard spec and any issues come out of that, please feel free to raise, as we are definitely aiming to keep compliant with the standard specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants