Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add macro for Service #35

Closed
tdeleon opened this issue Dec 22, 2023 · 0 comments
Closed

Add macro for Service #35

tdeleon opened this issue Dec 22, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@tdeleon
Copy link
Owner

tdeleon commented Dec 22, 2023

Add a macro for an API service to allow for clearer code and reducing boilerplate. As part of this change, the Service typealias would be deprecated.
Example usage:

@RestAPI
enum MyAPI {
}

expands to

enum MyAPI: APIComponent {
}

The required baseURL could also be optionally provided through the macro:

@RestAPI("https://example.com/")
enum MyAPI {
}

expands to:

enum MyAPI: APIComponent {
   static let baseURL = URL(string: "https://example.com/)!
}

Note: Since macros require swift 5.9, an @available marker needs to be added to the macro declaration to avoid the entire package minimum swift version needing to be raised.

Documentation: #37

@tdeleon tdeleon added this to the 3.0.0 milestone Dec 22, 2023
@tdeleon tdeleon added the enhancement New feature or request label Dec 22, 2023
tdeleon added a commit that referenced this issue Dec 28, 2023
tdeleon added a commit that referenced this issue Dec 28, 2023
…ation; remove unnecessary @attached member declaration; remove macro without baseURL paramater
tdeleon added a commit that referenced this issue Jan 1, 2024
tdeleon added a commit that referenced this issue Jan 2, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
tdeleon added a commit that referenced this issue Jan 3, 2024
* #35 Adding  RestAPI macro

* #35: Add missing names parameter for @attached extension macro declaration; remove unnecessary @attached member declaration; remove macro without baseURL paramater

* #35: Rename @RESTapi to @apiservice

* Update test.yml for swift 5.9

* Update test.yml

* Add macros target as test dependency

* #35: Temporarily disable macros tests on windows

* #35 temporarily disable building macros on windows when testing

* #35: Disable macros on windows during tests

* #35: Don't use macros in regular unit tests

* Update test.yml to set Xcode 15.1 on macOS 13 runner

* Update test.yml - select swift version

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* #35: Complete macro renaming

* #35: Add error handling for @apiservice macro

* #35: Maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* #35: maintain support for swift <5.9

* Report swift version in ci action

* #35: Remove  unnecessary import check
@tdeleon tdeleon closed this as completed Jan 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant