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

Add SpringDoc #538

Merged
merged 3 commits into from
Jan 16, 2022
Merged

Add SpringDoc #538

merged 3 commits into from
Jan 16, 2022

Conversation

Bolo89
Copy link
Contributor

@Bolo89 Bolo89 commented Jan 16, 2022

Hello,

Example :

{
  "folder": "/home/bolo/Projects/my-project-test",
  "generator-jhipster": {
    "projectName": "Beer Project",
    "baseName": "beer",
    "prettierDefaultIndent": 2,
    "packageName": "tech.jhipster.beer"
    "apiTitle": "My API",
    "apiDescription": "My API description",
    "apiLicenseName": "Custom 5.0",
    "apiLicenseUrl": "http://license-url.fr",
    "apiExternalDocDescription": "External API doc description",
    "apiExternalDocUrl": "http://external-api-doc.fr"
  }
}

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2022

CLA assistant check
All committers have signed the CLA.

@pascalgrimaud
Copy link
Member

Huge work @Bolo89 !
Thanks so much, as I'll need this very soon.
I'll do my best to review it today or tomorrow :-)

@codecov
Copy link

codecov bot commented Jan 16, 2022

Codecov Report

Merging #538 (a62b125) into main (9c5b3bc) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##                main      #538   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       846       863   +17     
===========================================
  Files            155       160    +5     
  Lines           2582      2643   +61     
  Branches          57        57           
===========================================
+ Hits            2582      2643   +61     
Impacted Files Coverage Δ
...ngdoc/application/SpringDocApplicationService.java 100.00% <100.00%> (ø)
...ver/springboot/mvc/springdoc/domain/SpringDoc.java 100.00% <100.00%> (ø)
...t/mvc/springdoc/domain/SpringDocDomainService.java 100.00% <100.00%> (ø)
...rastructure/config/SpringDocBeanConfiguration.java 100.00% <100.00%> (ø)
...infrastructure/primary/rest/SpringDocResource.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c5b3bc...a62b125. Read the comment docs.

@pascalgrimaud
Copy link
Member

pascalgrimaud commented Jan 16, 2022

Not related to this PR, but we have 2 possible uses cases about Security

1st use case:

  • add springdoc
  • add Security JWT (or OAuth2 later)
  • should do something to springdoc code <---

2nd use case:

  • add Security
  • add springdoc, we could generate immediatly the security part

Let's do this in another PR, I have some ideas, using Spring Events

Related to this answer https://stackoverflow.com/questions/59357205/springdoc-openapi-apply-default-global-securityscheme-possible , the security part to add could be something like:

.components(
        new Components()
          .addSecuritySchemes(
            "bearer-jwt",
            new SecurityScheme()
              .type(SecurityScheme.Type.HTTP)
              .scheme("Bearer")
              .bearerFormat("JWT")
              .in(SecurityScheme.In.HEADER)
              .name("bearerAuth")
          )
      )
      .addSecurityItem(new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write")))

@pascalgrimaud pascalgrimaud merged commit 244acdd into jhipster:main Jan 16, 2022
@Bolo89
Copy link
Contributor Author

Bolo89 commented Jan 21, 2022

Hello,
Bounty claimed at https://opencollective.com/generator-jhipster/expenses/61784

@pascalgrimaud
Copy link
Member

@Bolo89 : approved! Thanks so much for your 1st contribution

@Bolo89 Bolo89 deleted the add-spring-doc branch May 20, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring Boot Web: add swagger with springdoc
3 participants