3

I am creating API documentations for my APIs. while creating am stuck in a problem that : I want to generate server side code for my API by which user can easily implement that code. I read about "codegen" by swagger by which one can generate code in different languages. So any please suggest me how to use that feature to generate code in different language (java,php...). or any alternative for this. also Guide me if i am wrong at any point of view. Thanks in advance.

1 Answer 1

1

Given that you've the API documented in OpenAPI/Swagger spec, you can use Swagger Codegen to generate PHP server stub (Slim, Silex, Lumne) very easily.

Please refer to the wiki for more information.

Sign up to request clarification or add additional context in comments.

4 Comments

As i am new to api and its documentation please tell me process of implementing the code in link . not able to understand the code. :(
OK. Instead of running the JAR locally, you can use editor.swagger.io. After you enter/import your spec into editor.swagger.io, you can click on "Generate Server" in the menu at the top and select the server framework (e.g. Slim).
thanks for this. But i want to show client/server side code on UI documentation of API. But from here only we can download the code. So please tell is there any way to show the client code on swagger UI.
I'm not aware of anyway to do that in Swagger UI. There's a PR to add a API documentation generator in Swagger Codegen which may meet your requirement: github.com/swagger-api/swagger-codegen/pull/3447

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.