Skip to content

Bumps OpenAPIKit to version 3.0.0-alpha.7 fixing an issue with trailing slashes. #69

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

Merged
merged 4 commits into from
Jun 19, 2023

Conversation

miguel-arrf
Copy link
Contributor

@miguel-arrf miguel-arrf commented Jun 15, 2023

Motivation

As discussed in #51, there was an issue with paths containing trailing slashes. The problem was identified in the OpenAPIKit dependency. It was fixed in the PR mattpolzin/OpenAPIKit#274.

Modifications

This PR updates the OpenAPIKit dependency version from 3.0.0-alpha.6 to 3.0.0-alpha.7 (available here), which includes the mentioned PR.

Result

If a path ends with a trailing slash, such as foo/bar/, the generated functions will now correctly call the path foo/bar/ instead of (as previously) foo/bar.

Test Plan

Replaced an endpoint in the reference test to use a path with a trailing slash.

Resolves

@simonjbeaumont
Copy link
Collaborator

@miguel-arrf Thanks for driving this! 🙏

⚠️ No steps have been taken yet to test this PR. The existing tests should be updated to include paths with trailing slashes.

Is this something you intend to do in this PR?

@simonjbeaumont
Copy link
Collaborator

@swift-server-bot add to allowlist

@czechboy0
Copy link
Contributor

You could just change one of the paths in the integration test to end with a slash instead of adding another path+operation. But it'd be good for our tests to include this case.

Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. Based on the discussion here and on the issue, I'll mark this as request changes, until we get the test changed.

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Thanks @miguel-arrf for updating the tests, but I don't think we need a new operation for it, as those are pretty expensive to maintain (as you just saw when adding a new one), so we add new ones sparingly, only when we can't extend existing ones. An easier alternative is to modify the path of one of the existing operations, and update the corresponding test.

@miguel-arrf
Copy link
Contributor Author

@czechboy0 Ah, I see! Thank you, I'll update it accordingly :)!

@miguel-arrf miguel-arrf force-pushed the OpenAPIKit-version-bump branch 2 times, most recently from d89e360 to 167b0b6 Compare June 19, 2023 16:40
@miguel-arrf
Copy link
Contributor Author

(I still have some more tests to change, because of the Server!)

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Looks great, thank you, @miguel-arrf! 🙏

@simonjbeaumont
Copy link
Collaborator

simonjbeaumont commented Jun 19, 2023

@miguel-arrf Looks great!

Would you like to update the PR description given you've gone to the effort of sorting the testing out?

⚠️ No steps have been taken yet to test this PR. The existing tests should be updated to include paths with trailing slashes.

EDIT: Actually, don't worry—I'll do it.

Thanks for the contribution!

@simonjbeaumont simonjbeaumont enabled auto-merge (squash) June 19, 2023 18:35
@simonjbeaumont simonjbeaumont merged commit c41395a into apple:main Jun 19, 2023
@miguel-arrf
Copy link
Contributor Author

Thanks @simonjbeaumont ! ☺️

@czechboy0 czechboy0 added 🆕 semver/minor Adds new public API. 🔨 semver/patch No public API change. and removed 🆕 semver/minor Adds new public API. labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with paths ending with a slash
4 participants