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(core): inconsistent kebab casing comparison #937

Conversation

fergiektid
Copy link
Contributor

@fergiektid fergiektid commented Sep 13, 2023

Status

READY

Fix #936

Description

This PR aims to resolve issue #936. Which causes potentially invalid typescript to be generated by Orval. Need to ensure that we are comparing like for like when searching the array of tags for a specific tag.

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

#936 (comment)

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixing an issue where operationNames were being filtered out
and not provided to builder.footer.

generateTargetTags returns kebab-cased tags which are then
compared to operation tags which have not been run through
the kebab routine.

map all operation tags with kebab prior to checking that
the tags include a tag.
@vercel
Copy link

vercel bot commented Sep 13, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel.

@anymaniax first needs to authorize it.

@anymaniax
Copy link
Collaborator

Hello @fergiektid, thanks for the pr. We should kebab both side to be sure no?

Fixing an issue where operationNames were being filtered out
and not provided to builder.footer.

generateTargetTags returns kebab-cased tags which are then
compared to operation tags which have not been run through
the kebab routine.

map all operation tags with kebab prior to checking that
the tags include a tag.

Added some additional unit tests to ensure that the kebab
routine is Idempotent.
@fergiektid
Copy link
Contributor Author

fergiektid commented Oct 1, 2023

Hello @fergiektid, thanks for the pr. We should kebab both side to be sure no?

Yes, In this specific instance, I don't think we need to because it's already been called for the right hand side. But I don't see any harm in doing it again as a safety net against future refactoring.

I've added a test for the kebab case routine to ensure that the kebab routine remains Idempotent, since we are potentially calling it multiple times with input which has already been through the routine.

I have updated the PR.

anymaniax
anymaniax previously approved these changes Oct 19, 2023
Copy link
Collaborator

@anymaniax anymaniax left a comment

Choose a reason for hiding this comment

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

Thanks!

@anymaniax
Copy link
Collaborator

Can you resolve the conflict pls?

melloware
melloware previously approved these changes Oct 20, 2023
@melloware melloware dismissed stale reviews from anymaniax and themself via 159b368 November 5, 2023 16:04
@melloware melloware merged commit 88dd4ff into orval-labs:master Nov 5, 2023
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.

Incomplete HTTP calls file causing typescript warnings on files generated by orval
4 participants