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

Use AsciiDoc AST to create open v3 support #381

Merged

Conversation

austek
Copy link
Contributor

@austek austek commented Jan 14, 2020

OpenApi v3 support #340 schema document support implemented as follows;

  • OpenAPI Object (implemented)
  • Info Object (implemented)
  • Contact Object (implemented)
  • License Object (implemented)
  • Server Object (implemented)
  • Server Variable Object (implemented)
  • Components Object (partially implemented, needs: securitySchemes, callbacks, requestBodies, examples)
  • Paths Object (implemented)
  • Path Item Object (implemented)
  • Operation Object (partially implemented, needs: securitySchemes, callbacks, requestBodies, examples)
  • External Documentation Object (implemented)
  • Parameter Object (implemented)
  • Request Body Object
  • Media Type Object
  • Encoding Object
  • Responses Object (implemented)
  • Response Object (implemented)
  • Callback Object
  • Example Object
  • Link Object (implemented)
  • Header Object (implemented)
  • Tag Object (implemented)
  • Reference Object (implemented)
  • Schema Object (implemented)
  • Discriminator Object (not-implemented)
  • XML Object (not-implemented)
  • Security Scheme Object (not-implemented)
  • OAuth Flows Object (not-implemented)
  • OAuth Flow Object (not-implemented)
  • Security Requirement Object (not-implemented)

@austek austek requested a review from RobWin January 14, 2020 20:25
@austek austek force-pushed the refactor/Asciidoctor_ast_implementation branch from 0d6618b to ad19687 Compare January 14, 2020 20:26
Copy link
Member

@RobWin RobWin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation has an extension mechanism where users can inject AsciiDoc/Markdown at certain positions.
Do you plan to add such an extension mechanism as well?

The current implementation allows configure the order of the parameters, operations and definitions.
It also allows to group paths by tags.
Do you plan to add this configuration option as well?


public class OpenApiHelpers {

public static final String LABEL_DEFAULT = "Default";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internationalization: I think labels should be localized like in the current implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internationalization will be supported, that's the reason, all strings are collected in one place to make it easier to do that. Just wanted to do an initial pass for v3 support

pathItem.readOperationsMap().forEach(((httpMethod, operation) -> {
SectionImpl operationSection = new SectionImpl(allPathsSection);
String summary = Optional.ofNullable(operation.getSummary()).orElse("");
operationSection.setTitle((italicUnconstrained(httpMethod.name().toUpperCase()) + " " + monospaced(name) + " " + summary).trim());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to how it looks today?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly can be done, I opted for the current implementation as summary is an optional value can be missing. what could be used for such scenarios?

@austek austek force-pushed the refactor/Asciidoctor_ast_implementation branch from b9aaf43 to e6706d7 Compare January 15, 2020 11:02
@RobWin RobWin merged commit b4e8e17 into feature/open_api_v3_support Jan 15, 2020
@austek austek deleted the refactor/Asciidoctor_ast_implementation branch January 15, 2020 14:17
austek added a commit that referenced this pull request Mar 5, 2020
* Use Asciidoc AST to create OpenApi v3 support

* Add `Overview` information

* Add `Servers` information

* Fix document authors

* Fix document authors

* Add `Servers` information

* Add `Servers` information

* Add `Servers` information

* Add `Servers` information

* Add `Path Parameters` information

* Add `Path Parameters` information

* Add `Path Responses Links` information

* Add `Tags` information

* Add `Comonents.Schemas` information

* Add `Comonents.Parameters` information

* Add `External Docs` information

* Add `Components Responses` information

* Add `Components Headers` information

* Add `Components Links` information

* Delete unused test fixtures

* Change asciidoctorJ dependency to asciidoctorj-api, to remove the the need for JRuby
@ewoks
Copy link

ewoks commented Aug 5, 2020

Not 100% sure about the plans, but this ticket is probably ready to be closed. Correct?

@admoca60
Copy link

Hi @RobWin !!

I could see that this feature is merged to master, but none new version of this artifact has been released from two years ago.

Do you have any plan about doing a new release with these changes? Will be this feature available to be used with maven plugin?

Thank you!

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

Successfully merging this pull request may close these issues.

4 participants