-
Notifications
You must be signed in to change notification settings - Fork 20
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(client): ensure urls have trailing slashes #361
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2f97df2
fix(client): ensure urls have trailing slashes
mitchnielsen c09e0cc
Add script to check for trailing slash routes
mitchnielsen dde587f
Merge branch 'main' of github.com:PrefectHQ/terraform-provider-prefec…
mitchnielsen a073d40
Flows: put trailing slash on the right field
mitchnielsen 38edad2
Add note to contributing docs
mitchnielsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script checks for all endpoints that require a trailing slash. | ||
# Files in internal/client/*.go should be checked to confirm that any | ||
# `url` fields in the request configuration include the trailing slash | ||
# when needed. | ||
# | ||
# This helps avoid errors like https://github.com/PrefectHQ/terraform-provider-prefect/issues/359. | ||
# | ||
# It can be helpful to redirect the output to a file for further analysis: | ||
# | ||
# ./scripts/trailing-slash-routes > trailing-slash-routes.json | ||
# | ||
# You can then use tools like `jq` to parse the results. | ||
# | ||
# Example output: | ||
# | ||
# [ | ||
# { | ||
# "path": "/api/accounts/{account_id}/teams/", | ||
# "method": "post", | ||
# "desc": "Create or update a team's metadata.\n\nRequired account permissions: `create:team`" | ||
# }, | ||
# { | ||
# "path": "/api/accounts/{account_id}/bots/", | ||
# "method": "post", | ||
# "desc": "Create a Bot\n\nRequired account permissions: `create:bot`" | ||
# }, | ||
# ... | ||
# } | ||
|
||
curl -s https://api.prefect.cloud/api/openapi.json | | ||
jq '.paths | ||
| to_entries | ||
| map({path: .key, method: (.value | to_entries[0].key), desc: (.value | to_entries[0].value.description)}) | ||
| map(select(.path | test("/$")))' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is great! Is there anywhere in our development guides that we should add a note/reference to this to point community contributors to?
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.
good idea, I'll add a note in the Contributing guide 👌
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.
done in 38edad2