-
Notifications
You must be signed in to change notification settings - Fork 125
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
Idiomatic naming strategy as opt-in #679
Idiomatic naming strategy as opt-in #679
Conversation
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Sources/swift-openapi-generator/Documentation.docc/Proposals/SOAR-0013.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Si Beaumont <[email protected]>
…swift-openapi-generator into hd-naming-strategy-optimistic
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.
Thanks @czechboy0! Overall this looks good. There are a couple of things I think we should change: config management, use in tests, etc.
Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/SwiftSafeNames.swift
Outdated
Show resolved
Hide resolved
Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/SwiftSafeNames.swift
Outdated
Show resolved
Hide resolved
Tests/OpenAPIGeneratorCoreTests/Extensions/Test_SwiftSafeNames.swift
Outdated
Show resolved
Hide resolved
Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Si Beaumont <[email protected]>
…will be moved around in subsequent commits, not final
…the idiomatic strategy
Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/TypeAssigner.swift
Outdated
Show resolved
Hide resolved
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.
Thanks for getting this one this far @czechboy0 :)
As per this comment and our additional discussion offline, I think we need to revisit the design of the TypeAssigner
and the coupling with the naming logic.
Previously we just called into some closure which was in the context, which took no options. Now we have two strategies we've added a lot of complexity to the assigner in how it should call the closure, and since we're dealing with casing, we're also having to call the idiomatic strategy in a different way for different contexts in which it's used.
We didn't love the design before, but trying to stick with it for this feature is resulting in a lot of increased complexity and I think we should refactor to decouple the assigner and namer and create a better abstraction.
I'd personally prefer to see that as part of this PR, rather than moving things in the wrong direction temporarily.
But since this PR does add the feature we need, with the design we have, we can follow it up after.
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 really nice—thanks!
Motivation
Implementation of #683.
Modifications
Result
SOAR-0013 implemented.
Test Plan
Updated and added new unit tests.