Conversation
…be passed to api clients instead of a global configuration, provide a default implementation with a singleton option
|
@fehguy @wing328 The original motivation was this issue: #1981 The change to Furthermore during integration in our project I ran into the limitation of having only a single global configuration object and not being able to provide a different configurations for different ApiClient instances. Thus I reworked the code to make the configuration a component of the ApiClient which can be passed in during client creation. It results in less global state, higher configurability and less coupling - but only if required, since there are still fallbacks to global defaults. Thus the only breaking change in the API is the return value of the API calls ( The original description of the changes can be found in PR #3391:
|
|
@wing328 👍 Looks good to me |
Upgrade Note(1) {classPrefix}Configuration has been renamed to {classPrefix}DefaultConfiguration, e.g. SWGConfiguration *config = [SWGConfiguration sharedConfig];After: SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig];(2) Return type for API functions has been changed from -(NSNumber*) addPetWithBody: (SWGPet*) bodyAfter -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body |
* change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber * define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option * integrate a workaround for a current JSONModel concurrency bug * update to new ISO8601 pod * add missing call to super * integrate new templates into codegen * updates documentation templates * updates petstore objc generated code * fixes objc client tests
* Feature/objc tasks 2.3.0 (#3522) * change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber * define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option * integrate a workaround for a current JSONModel concurrency bug * update to new ISO8601 pod * add missing call to super * integrate new templates into codegen * updates documentation templates * updates petstore objc generated code * fixes objc client tests * [ObjC] Add version define and share default headers of each client * add finch generator and resource * update license, add errros * Fix problem with multitheard api client * fix some errors for finch * [finch] Remove license header * [finch] Remove finatra stuff, fix a few issues * WIP: Finch server generator * [finch] WIP: server generator impl This puts parameters (input/output) in the right format. Currently, this is done in the generator class using vendorExtensions, but should be refactored to imported templates to clean up. Previous commits of the server generator output to appropriate models/api directories. I've made no changes to this logic, but code currently generates to the root scala package directory. This will need to be fixed. There's also an issue with circe's and Option[Date] in the Order type. This issue will need to be resolved. As well, there's some unused imports to clean up. Initial implementation lacks support for custom imports, type mappings, etc. * [finch] Update api/model package and imports * [finch] Explicit import/type mappings * [finch] Regenerate example
* Feature/objc tasks 2.3.0 (swagger-api#3522) * change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber * define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option * integrate a workaround for a current JSONModel concurrency bug * update to new ISO8601 pod * add missing call to super * integrate new templates into codegen * updates documentation templates * updates petstore objc generated code * fixes objc client tests * [ObjC] Add version define and share default headers of each client * add finch generator and resource * update license, add errros * Fix problem with multitheard api client * fix some errors for finch * [finch] Remove license header * [finch] Remove finatra stuff, fix a few issues * WIP: Finch server generator * [finch] WIP: server generator impl This puts parameters (input/output) in the right format. Currently, this is done in the generator class using vendorExtensions, but should be refactored to imported templates to clean up. Previous commits of the server generator output to appropriate models/api directories. I've made no changes to this logic, but code currently generates to the root scala package directory. This will need to be fixed. There's also an issue with circe's and Option[Date] in the Order type. This issue will need to be resolved. As well, there's some unused imports to clean up. Initial implementation lacks support for custom imports, type mappings, etc. * [finch] Update api/model package and imports * [finch] Explicit import/type mappings * [finch] Regenerate example
@wing328 As agreed in PR #3391 I created a new PR for branch 2.3.0.
This replaces PR #3510.