CreateAPI / CreateAPI/CreateAPI

Add official way to opt out of using Get

Open
#84 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Swift
Stars
447
Forks
42
PR merge metrics
No merged PRs in 30d

Description

# 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...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.