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(mangling): fixed name mangling when special chars are substituted #78

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

fredbi
Copy link
Member

@fredbi fredbi commented Dec 27, 2023

This PR fixes name mangling methods (ToJSONName, ToCommandName, etc) for cases when a special character is expanded, like so: "get$ref" should be jasonified as "getDollarRef".

The issue was that the extra space added was not trimmed before name reconstruction, so in the example above, we get "getDollar Ref" instead.

This PR fixes name mangling methods (ToJSONName, ToCommandName, etc)
for cases when a special character is expanded, like so:
"get$ref" should be jasonified as "getDollarRef".

The issue was that the extra space added was not trimmed before
name reconstruction, so in the example above, we get "getDollar Ref"
instead.

* contributes go-swagger/go-swagger#2821

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0ddf107) 85.45% compared to head (c1809de) 85.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   85.45%   85.45%           
=======================================
  Files          12       12           
  Lines        1609     1609           
=======================================
  Hits         1375     1375           
  Misses        202      202           
  Partials       32       32           
Flag Coverage Δ
oldstable 85.45% <100.00%> (ø)
stable 85.45% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fredbi added a commit to fredbi/go-swagger that referenced this pull request Dec 27, 2023
…cter

This PR fixes a special case when a "$" is inside a name AND we generate
polymorphic types.

In this case the unexported name was not properly generated (included a blank space).
More generally, swag mangling functions fail to properly handle this
extra blank space. Fortunately, ToGoName wasn't affected and this is why
this failure occurs in such rare circumstances.

* requires go-openapi/swag#78
* fixes go-swagger#2821

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi fredbi merged commit b3e7a53 into go-openapi:master Dec 27, 2023
10 checks passed
@fredbi fredbi deleted the fix/2821 branch December 27, 2023 17:50
fredbi added a commit to fredbi/go-swagger that referenced this pull request Dec 27, 2023
…cter

This PR fixes a special case when a "$" is inside a name AND we generate
polymorphic types.

In this case the unexported name was not properly generated (included a blank space).
More generally, swag mangling functions fail to properly handle this
extra blank space. Fortunately, ToGoName wasn't affected and this is why
this failure occurs in such rare circumstances.

* requires go-openapi/swag#78
* fixes go-swagger#2821

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi added a commit to fredbi/go-swagger that referenced this pull request Dec 27, 2023
…cter

This PR fixes a special case when a "$" is inside a name AND we generate
polymorphic types.

In this case the unexported name was not properly generated (included a blank space).
More generally, swag mangling functions fail to properly handle this
extra blank space. Fortunately, ToGoName wasn't affected and this is why
this failure occurs in such rare circumstances.

* requires go-openapi/swag#78
* fixes go-swagger#2821

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi added a commit to go-swagger/go-swagger that referenced this pull request Dec 27, 2023
…cter

This PR fixes a special case when a "$" is inside a name AND we generate
polymorphic types.

In this case the unexported name was not properly generated (included a blank space).
More generally, swag mangling functions fail to properly handle this
extra blank space. Fortunately, ToGoName wasn't affected and this is why
this failure occurs in such rare circumstances.

* requires go-openapi/swag#78
* fixes #2821

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
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.

None yet

2 participants