go-openapi / swag

goodie bag in use in the go-openapi projects
Apache License 2.0
184 stars 46 forks source link

fix(mangling): fixed name mangling when special chars are substituted #78

Closed fredbi closed 10 months ago

fredbi commented 10 months ago

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.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/go-openapi/swag/pull/78/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | Coverage Δ | | |---|---|---| | [oldstable](https://app.codecov.io/gh/go-openapi/swag/pull/78/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `85.45% <100.00%> (ø)` | | | [stable](https://app.codecov.io/gh/go-openapi/swag/pull/78/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `85.45% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.