Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
[SELC-3460] feat: added tag external-v2 for automatic generation of o…
Browse files Browse the repository at this point in the history
…pen-api (#328)

* Added tag to single api to generate open-api for APIM

* Added tag external-v2 for automatic generation of open-api

* Added top level tag for APIM api

---------

Co-authored-by: [email protected] <Aiap1955?^@#>
Co-authored-by: manuraf <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 7bd9ff2 commit fd6dd09
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/resources/swagger/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
},
"/delegations" : {
"get" : {
"tags" : [ "Delegation" ],
"tags" : [ "Delegation", "external-v2", "support" ],
"summary" : "Retrieve institution's delegations",
"description" : "Retrieve institution's delegations",
"operationId" : "getDelegationsUsingGET",
Expand Down Expand Up @@ -1444,7 +1444,7 @@
},
"/institutions" : {
"get" : {
"tags" : [ "Institution" ],
"tags" : [ "Institution", "external-v2", "support" ],
"summary" : "Gets institutions filtering by taxCode and/or subunitCode",
"description" : "Gets institutions filtering by taxCode and/or subunitCode",
"operationId" : "getInstitutionsUsingGET",
Expand Down Expand Up @@ -2244,7 +2244,7 @@
},
"/institutions/{id}" : {
"get" : {
"tags" : [ "Institution" ],
"tags" : [ "Institution", "external-v2" ],
"summary" : "Gets the corresponding institution using internal institution id",
"description" : "Gets the corresponding institution using internal institution id",
"operationId" : "retrieveInstitutionByIdUsingGET",
Expand Down Expand Up @@ -2711,7 +2711,7 @@
},
"/institutions/{institutionId}/onboardings" : {
"get" : {
"tags" : [ "Institution" ],
"tags" : [ "Institution", "external-v2" ],
"summary" : "${swagger.mscore.institution.info}",
"description" : "${swagger.mscore.institution.info}",
"operationId" : "getOnboardingsInstitutionUsingGET",
Expand Down Expand Up @@ -2848,7 +2848,7 @@
},
"/institutions/{institutionId}/users" : {
"get" : {
"tags" : [ "Institution" ],
"tags" : [ "Institution", "support" ],
"summary" : "getInstitutionUsers",
"description" : "Retrieve institution's users",
"operationId" : "getInstitutionUsersUsingGET",
Expand Down Expand Up @@ -4352,7 +4352,7 @@
},
"/onboarding/users" : {
"post" : {
"tags" : [ "Onboarding" ],
"tags" : [ "Onboarding", "support" ],
"summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
"description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
"operationId" : "onboardingInstitutionUsersUsingPOST",
Expand Down Expand Up @@ -4557,7 +4557,7 @@
},
"/tokens/products/{productId}" : {
"get" : {
"tags" : [ "Token" ],
"tags" : [ "Token", "external-v2" ],
"summary" : "${swagger.mscore.tokens.findFromProduct}",
"description" : "${swagger.mscore.tokens.findFromProduct}",
"operationId" : "findFromProductUsingGET_1",
Expand Down Expand Up @@ -4973,7 +4973,7 @@
},
"/users/{id}" : {
"get" : {
"tags" : [ "Persons" ],
"tags" : [ "Persons", "external-v2", "support" ],
"summary" : "Retrieves user given userId and optional ProductId",
"description" : "Retrieves user given userId and optional ProductId",
"operationId" : "getUserInfoUsingGET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import it.pagopa.selfcare.mscore.constant.GenericError;
import it.pagopa.selfcare.mscore.constant.GetDelegationsMode;
import it.pagopa.selfcare.mscore.core.DelegationService;
Expand Down Expand Up @@ -87,6 +89,7 @@ public ResponseEntity<DelegationResponse> createDelegationFromInstitutionsTaxCod
* * Code: 404, Message: Institution data not found, DataType: Problem
* * Code: 400, Message: Bad Request, DataType: Problem
*/
@Tags({@Tag(name = "external-v2"), @Tag(name = "support"), @Tag(name = "Delegation")})
@ApiOperation(value = "${swagger.mscore.institutions.delegations}", notes = "${swagger.mscore.institutions.delegations}")
@GetMapping()
public ResponseEntity<List<DelegationResponse>> getDelegations(@ApiParam("${swagger.mscore.institutions.model.institutionId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import it.pagopa.selfcare.commons.base.security.PartyRole;
import it.pagopa.selfcare.commons.base.security.SelfCareUser;
import it.pagopa.selfcare.commons.base.utils.InstitutionType;
Expand Down Expand Up @@ -74,6 +76,7 @@ public InstitutionController(InstitutionService institutionService,
* * Code: 400, Message: Bad Request, DataType: Problem
* * Code: 404, Message: Products not found, DataType: Problem
*/
@Tags({@Tag(name = "support"), @Tag(name = "external-v2"), @Tag(name = "Institution")})
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "${swagger.mscore.institutions}", notes = "${swagger.mscore.institutions}")
@GetMapping
Expand Down Expand Up @@ -386,6 +389,7 @@ public ResponseEntity<List<GeographicTaxonomies>> retrieveInstitutionGeoTaxonomi
* * Code: 200, Message: successful operation, DataType: InstitutionResponse
* * Code: 404, Message: GeographicTaxonomies or Institution not found, DataType: Problem
*/
@Tags({@Tag(name = "external-v2"), @Tag(name = "Institution")})
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "${swagger.mscore.institution}", notes = "${swagger.mscore.institution}")
@GetMapping(value = "/{id}")
Expand Down Expand Up @@ -437,6 +441,7 @@ public ResponseEntity<List<RelationshipResult>> getUserInstitutionRelationships(
* * Code: 200, Message: successful operation, DataType: List<RelationshipResult>
* * Code: 404, Message: GeographicTaxonomies or Institution not found, DataType: Problem
*/
@Tags({@Tag(name = "external-v2"), @Tag(name = "Institution")})
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "${swagger.mscore.institution.info}", notes = "${swagger.mscore.institution.info}")
@GetMapping(value = "/{institutionId}/onboardings")
Expand Down Expand Up @@ -548,6 +553,7 @@ public Collection<BrokerResponse> getInstitutionBrokers(@ApiParam("${swagger.msc
return result;
}

@Tags({@Tag(name = "support"), @Tag(name = "Institution")})
@GetMapping(value = "/{institutionId}/users")
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "", notes = "${swagger.mscore.institutions.api.getInstitutionUsers}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import it.pagopa.selfcare.commons.base.logging.LogUtils;
import it.pagopa.selfcare.commons.base.security.PartyRole;
import it.pagopa.selfcare.commons.base.security.SelfCareUser;
Expand Down Expand Up @@ -309,6 +311,7 @@ public ResponseEntity<List<RelationshipResult>> onboardingInstitutionSubDelegate
* * Code: 400, Message: Invalid request, DataType: Problem
*/
@ResponseStatus(HttpStatus.OK)
@Tags({@Tag(name = "support"), @Tag(name = "Onboarding")})
@ApiOperation(value = "${swagger.mscore.onboarding.users}", notes = "${swagger.mscore.onboarding.users}")
@PostMapping(value = "/users")
public ResponseEntity<List<RelationshipResult>> onboardingInstitutionUsers(@RequestBody @Valid OnboardingInstitutionUsersRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import it.pagopa.selfcare.mscore.constant.GenericError;
import it.pagopa.selfcare.mscore.core.TokenService;
import it.pagopa.selfcare.mscore.model.onboarding.Token;
Expand Down Expand Up @@ -89,6 +91,7 @@ public TokenResource getToken(@ApiParam("${swagger.mscore.institution.model.id}"
* * Code: 200, Message: successful operation
* * Code: 404, Message: product not found
*/
@Tags({@Tag(name = "external-v2"), @Tag(name = "Token")})
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "${swagger.mscore.tokens.findFromProduct}", notes = "${swagger.mscore.tokens.findFromProduct}")
@GetMapping(value = "/tokens/products/{productId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import it.pagopa.selfcare.commons.base.security.SelfCareUser;
import it.pagopa.selfcare.mscore.constant.GenericError;
import it.pagopa.selfcare.mscore.constant.RelationshipState;
Expand Down Expand Up @@ -239,6 +241,7 @@ public ResponseEntity<Void> deleteProducts(@ApiParam("${swagger.mscore.relations
* * Code: 400, Message: Invalid ID supplied, DataType: Problem
* * Code: 404, Message: Not found, DataType: Problem
*/
@Tags({@Tag(name = "support"), @Tag(name = "external-v2"), @Tag(name = "Persons")})
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "${swagger.mscore.users}", notes = "${swagger.mscore.users}")
@GetMapping(value = "/users/{id}")
Expand Down

0 comments on commit fd6dd09

Please sign in to comment.