CreateAPI / CreateAPI/CreateAPI
Add official way to opt out of using Get
- 主要語言
- Swift
- 星號
- 447
- 分支
- 42
- PR 合併指標
- 30 天內沒有已合併 PR
描述
# Background
- https://github.com/CreateAPI/CreateAPI/pull/82#discussion_r936948277
As it stands, to opt out of using Get, you must do three things:
1. Use `--module` mode
2. Update `paths.imports` to be an empty array
3. Provide your own `Request` shim
While we believe that using CreateAPI with Get it the quickest and easiest option, we understand that not everybody is in a position to adopt Get. As a result, we need to provide a better way to disable use of the dependency.
# Description
I can think of three scenarios:
1. You want to use Get and you are happy with the default behaviour
2. Your networking client already defines it's own `Request` in a module that should be imported
3. You will build your networking client on top of the generated code and want a `Request` type generated for you
I did at first think that we should just generate `Request` if you opted not to use Get, but this will put some people who already import a different module defining `Request` in a situation where they can't use the generated code. It might be that like Get, the `Request` type is used for manually crafted requests too so defining it inside the CreateAPI generated package might not be appropriate.
Not sure how best to handle this...
貢獻指南
評估
這個 Issue 還沒有評估資料。