-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Question] Group API Endpoints by tags #23
Comments
Update: I changed template.yml to this: - path: request.swift
context: tags
destination: "Sources/Requests/{{ name|upperCamelCase }}.swift" then update public enum {{ operation.operationId|upperCamelCase }} {
public static let service = APIService<Response>(id: "{{ operationId }}", tag: "{{ tag }}", method: "{{ method|uppercase }}", path: "{{ path }}" ... {% endif %})
To: {% for operation in operations %}
public enum {{ operation.operationId|upperCamelCase }} {
public static let service = APIService<Response>(id: "{{ operation.operationId }}", tag: "{{ operation.tag }}", method: "{{ operation.method|uppercase }}", path: "{{ operation.path }}" .. .{% endif %})
{% endfor %}
Can we do it without adding |
Hi @dangthaison91 If you'd like to define an operation without always typing
And then move the relevant operation code to |
It would be great if you could submit your custom template in a PR when you're done! It can be added to |
Yeah, I have similar feelings to you about the Swagger Codegen Java project. I've also made quite a few PR's and also got sick of their java interface, so that was the main reason I actually created this |
Thank you so much @yonaskolb. I'd be happy to submit my PR when I've done. |
Hi @dangthaison91, how's your Moya template going? Anything you'd feel comfortable submitting? |
Hi @yonaskolb , I already created my own Moya template but having some problems while generating Models to use with Realm. I used in some company's project but sometimes I have to manual edit/fix errors. I pushed it to my folk repo, you can get it here: https://github.com/dangthaison91/SwagGen/tree/master/Templates/Swift-Moya I have created an example but need to remove private stuffs before making it public. |
@dangthaison91 Just you you know I've released 0.6.0. Check the release notes https://github.com/yonaskolb/SwagGen/releases/tag/0.6.0 |
@yonaskolb Oh, thanks for your reminder. I will check this weekend. |
Hi, first of all, thanks for your great work.
I'm working on creating RxSwift + Moya Swift template for Swagger. It worked perfectly after some modifications in Swift3 Codegen. I can finally make a PR but it is painful with inconsistent Java coding conventions, complex codebase.
Luckily, I found your awesome library while finalizing my code before making a PR (after nearly 2 months pending). I can easily understand your codes and implementing task #8. I will submit a PR after I finished.
But I have a question: It is possible to groups API Endpoints by their
tags
then put them in one file for example:Fake.swift, Pet.swift, Store.swift, User.swift
? I see your suggestion in #5 but couldn't find a solution for my case.The text was updated successfully, but these errors were encountered: