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

Support specifying integration-specific context type names. #36

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

tachyonics
Copy link
Contributor

Issue #, if available:

Description of changes: Support specifying integration-specific context type names. There are two use cases this change enables-

  1. A service wants to avoid using Existential Types in its context. With this change a service can-
    i. define a generic context type[1]
    ii. a non-generic typealias[2] in its integration target
    iii. specify the non-generic typealias[3] as the contextTypeName
    iv. then use a context with concrete types at runtime, avoiding the runtime overhead of existentials
    v. specify a context with Mock concrete types[4] for testing
  2. A service wants to be able to use a different context type name; for whatever reason the default currently expected by the code generator is not suitable.

[1] https://github.com/amzn/smoke-framework-examples/blob/no_existential_types_example/NoExistentialTypesExampleService/Sources/NoExistentialTypesExampleOperations/NoExistentialTypesExampleOperationsContext.swift#L35
[2] https://github.com/amzn/smoke-framework-examples/blob/no_existential_types_example/NoExistentialTypesExampleService/Sources/NoExistentialTypesExampleOperationsHTTP1/HTTPNoExistentialTypesExampleOperationsContext.swift#L24
[3] https://github.com/amzn/smoke-framework-examples/blob/no_existential_types_example/NoExistentialTypesExampleService/smoke-framework-codegen.json#L8
[4] https://github.com/amzn/smoke-framework-examples/blob/no_existential_types_example/NoExistentialTypesExampleService/Tests/NoExistentialTypesExampleOperationsTests/NoExistentialTypesExampleTestConfiguration.swift#L71

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tachyonics tachyonics merged commit 7bc9a74 into main Sep 6, 2022
@tachyonics tachyonics deleted the integration_specific_context_type_names branch September 6, 2022 22:54
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.

2 participants