How to generate Retrofit client library from wp rest api using swagger

I am creating android client for my WordPress website . Is there a way to generate retrofit 2 client library from wp rest client using swagger or is there any other tool to generate the same .

Related posts

3 comments

  1. Citing from here, yes it is part of the existing codegen module of swagger:

    The latest Java API client supports different HTTP client including
    Retrofit. To use Retrofit, please create a config.json file as
    follows:

    {
      "library": "retrofit"
    }
    

    and pass config.json via -c in the command line

    You can run java -jar
    modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help
    -l java for more information on customizing the Java API client.

  2. If you have a swagger 2.0 you better try Swagger Gradle Codegen,
    Generates Kotlin code and Retrofit interfaces, with RxJava2 for async calls, Moshi for serialization and ThreeTenABP for Data management

Comments are closed.