Skip to content
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

can i add some logic when create acsiidoc file from json file? #14

Open
flytosm opened this issue May 16, 2017 · 7 comments
Open

can i add some logic when create acsiidoc file from json file? #14

flytosm opened this issue May 16, 2017 · 7 comments

Comments

@flytosm
Copy link

flytosm commented May 16, 2017

@RobWin Hi,

I have a spring boot project, and we have created API document by springfox.
But we need to add further information to the API document.
*further information: response message, description of parameter
One way we can add this information to source code by annotation, but the workload of this way is heavy and so many duplicate works is there.
When I found this demo, which exchanges JSON (created in /v2/api-docs) to markdown/acsiidoc, I think whether I can add some logic to add the further information when the exchange is executing. Or whether I can add the further information into JSON (swagger specification) before the exchange.
I want to find the code for exchange logic but failed. Is exchange done by jar?
Would you tell me where the logic of exchange JSON to markdown/acsiidoc is?
Is it feasibility to add logic to where the logic of exchange is?

Best Regards,
Fly

@RobWin
Copy link
Member

RobWin commented May 16, 2017

Hi,

thanks for evaluating Swagger2Markup. I would love to get your GitHub Star in the Root Project, if you like it.
Have you already read the user guide: http://swagger2markup.github.io/swagger2markup/1.3.1/
It might answer some questions.

You can either add further information by including manual written Asciidoc/Markdown files to the index.adoc files. See Gradle Template Project as an example. Or you can use the Dynamic file import extension (which is also shown in the Gradle Template Project) to add file content at specific extensions points.

You could also write your own custom extensions.

You could use a different tool than Springfox, which uses JavaDoc to generate your Swagger Spec.

@flytosm
Copy link
Author

flytosm commented May 17, 2017

@RobWin Hi,
question of swagger.xlsx

Thanks very much for your answer.
What I want is not add including and extension, I want to reverse the Asciidoc which is generated.
Please check the attachment, which descripted my desire.

Add annotation in source code, can add the information I wanted.
But there is a lot of API, I need to copy same annotation everywhere.
I don’t want to do copy, want to merge the same annotation in one file, then I use some logic to add them to document.(JSON or Asciidoc).

I’m reading the document. Since I’m not native English speaker (I know you are neither ^^), would you please give me more hint on where is the code I can work on.

Best Regards

@flytosm
Copy link
Author

flytosm commented May 17, 2017

And i want to know, if i have a springboot project with spingfox, how can i add Swagger2Markup to my project?

@RobWin
Copy link
Member

RobWin commented May 17, 2017

Sry. But I won't open a xlsx file.
Please ask your questions in Markdown-format.

Swagger2Markup is just a Swagger YAML/JSON to Markdown/AsciiDoc converter.
The generation of a Swagger file from Source Code is out-of-scope. This is the scope of other projects like Springfox.

Please have a look at this demo project and our user guide to understand how to add Swagger2Markup to your SpringBoot application.

@flytosm
Copy link
Author

flytosm commented May 18, 2017

@RobWin
Got it, that is fine.
My question is as below.
image
image

And if i want to save the json file which is created by springfox, i need to add a junit source code such as the demo, is this right?

@RobWin
Copy link
Member

RobWin commented May 18, 2017

Again: You should ask these questions in the Springfox project.
As far as I know there is a PR which added this extension functionality in Springfox. See PR springfox/springfox#1254
See issue: springfox/springfox#1232

@keyone9
Copy link

keyone9 commented May 31, 2018

How to add the code block when use Swagger2Markup to generate adoc file automatic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants