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

fix: proper aggregation of strategies #4456

Merged
merged 4 commits into from
Aug 9, 2023

Conversation

gastonfournier
Copy link
Contributor

@gastonfournier gastonfournier commented Aug 9, 2023

About the changes

Open API is creating 2 resources under the same URL path, we want them aggregated:

$ curl -s https://us.app.unleash-hosted.com/ushosted/docs/openapi.json | jq '.paths."/api/admin/strategies/{name}" | keys'
[
  "delete",
  "get"
]
gaston@gaston-Summit-E16Flip-A12UCT: ~/poc/terraform-provider-unleash on main [!$]
$ curl -s https://us.app.unleash-hosted.com/ushosted/docs/openapi.json | jq '.paths."/api/admin/strategies/{strategyName}" | keys'
[
  "put"
]

Note one is under {name} while the other is under {strategyName}

@vercel
Copy link

vercel bot commented Aug 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2023 1:11pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2023 1:11pm

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

The name/strategyName fix is very welcome! 💯 I wasn't aware that booleans couldn't use enums. Do you have the docs for that anywhere? I'd ideally like to keep that as is because it accurately describes that state of the response, but if it causes issues, then changing it isn't really a big deal 😄

@gastonfournier
Copy link
Contributor Author

The name/strategyName fix is very welcome! 100 I wasn't aware that booleans couldn't use enums. Do you have the docs for that anywhere? I'd ideally like to keep that as is because it accurately describes that state of the response, but if it causes issues, then changing it isn't really a big deal smile

I confirmed that the boolean is fine for openapi spec 3.0 (we're on 3.0.3). Version 3.1 introduces const which would be more meaningful in this case, but I'm keeping it as is for now

@gastonfournier gastonfournier enabled auto-merge (squash) August 9, 2023 13:04
@gastonfournier gastonfournier merged commit 75c15e5 into main Aug 9, 2023
4 of 7 checks passed
@gastonfournier gastonfournier deleted the fix/proper-aggregation-of-strategies branch August 9, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants