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

Validate machine response against swagger spec. #515

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Gerrit91
Copy link
Contributor

@Gerrit91 Gerrit91 commented Mar 21, 2024

We often produce responses with our server that are not valid against the Swagger spec. For Go clients this seems not to be a big issue as type safety is guaranteed and it's not possible to produce server responses that violate type constraints. For other clients like Python there are much stricter validations though.

Our main problem that we made is to declare arrays without omitempty, which for Go Clients does not matter but for other languages it might be problematic.

This PR is non-breaking for Go Clients.

go.mod Outdated Show resolved Hide resolved
@Gerrit91
Copy link
Contributor Author

Gerrit91 commented Mar 25, 2024

For some fields we were lucky before because we returned directly what was returned from the RethinkDB, which never returns nil but an empty slice for document fields. Therefore we fulfilled the spec's contract without explicitly setting it, e.g. for destinationprefixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants