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

Add new DNS analytics endpoint to OpenAPI spec #558

Merged
merged 12 commits into from
Feb 9, 2024

Conversation

jacegu
Copy link
Contributor

@jacegu jacegu commented Feb 1, 2024

Closes dnsimple/dnsimple-app#25676

This PR:

  • Updates the OpenAPI spec with the new endpoint.

Note

This is my first time updating the OpenAPI spec so expect rough edges.

Note that I chose not to extract much to be referenced and write the spec pretty much in line: I do not think much of what we have in this endpoint is currently reusable.

@jacegu jacegu added the documentation Updates on the documentation and support content. label Feb 1, 2024
@jacegu jacegu self-assigned this Feb 1, 2024
Copy link
Contributor

@ggalmazor ggalmazor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall.

I left some suggestions with a few things I think we need to tweak

content/v2/openapi.yml Outdated Show resolved Hide resolved
content/v2/openapi.yml Outdated Show resolved Hide resolved
Comment on lines 3094 to 3100
enum:
- 'date:asc'
- 'date:desc'
- 'volume:asc'
- 'volume:desc'
- 'zone_name:asc'
- 'zone_name:desc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple sorting criteria can be defined. In fact, the default is "date:asc,zone_name:asc". Can we just not provide the enum here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed the example of other endpoints in which we are providing the enum, even when the values can be combined. Not sure if I did the right thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to interpret enum either...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we're not using them correctly if values can be combined https://swagger.io/docs/specification/data-models/enums/

It sounds like we would need to list all permutations under all possible sorting, which feels wrong to do. Maybe we should not have enum unless there's a finite list of values our customers need to pick from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at the same thing and I agree: I do not think this is the correct use. Will update this momentarily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: 1de58d1

@jacegu jacegu requested a review from ggalmazor February 1, 2024 09:39
Copy link
Contributor

@ggalmazor ggalmazor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@juankuquintana juankuquintana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 You could run it into https://editor.swagger.io/ to validate.

I did, and apparently we have an issue with another endpoint but nothing was raised with the new changes.

@jacegu jacegu requested a review from itsalyse February 5, 2024 15:50
@jacegu jacegu merged commit e3a8fc3 into main Feb 9, 2024
7 checks passed
@jacegu jacegu deleted the change/dns-analytics-openapi-spec branch February 9, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Updates on the documentation and support content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants