Skip to content

Commit

Permalink
[api] added auth mechanism to api docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeNeilson committed May 26, 2021
1 parent fb1c7a9 commit 284cdfb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class LocationController implements CrudHandler {
tags = {"Locations"},
responses = {
@OpenApiResponse(status="200", content = {@OpenApiContent( from = Location[].class,isArray=true)})
},
security = {
@OpenApiSecurity(name = "bearerAuth")
}
)
@Override
Expand All @@ -43,6 +46,9 @@ public void getAll( Context ctx){
responses = {
@OpenApiResponse(status="200", content = {@OpenApiContent( from = Location.class)})
},
security = {
@OpenApiSecurity(name = "bearerAuth")
},
tags = {"Locations"}
)
public void getOne( Context ctx, String locationName ){
Expand Down Expand Up @@ -88,11 +94,17 @@ public void create(Context ctx) {


@OpenApi(
security = {
@OpenApiSecurity(name = "bearerAuth")
},
tags = {"Locations"}
)
public void update(Context ctx, String locationName){ throw new UnsupportedOperationException("not implemented yet"); }

@OpenApi(
security = {
@OpenApiSecurity(name = "bearerAuth")
},
tags = {"Locations"}
)
public void delete(Context ctx, String locationName){ throw new UnsupportedOperationException("not implemented yet"); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public void getAll(Context ctx){
responses = {
@OpenApiResponse(status="200", content = {@OpenApiContent( from = TimeSeries.class)}),
@OpenApiResponse(status="404", content = {@OpenApiContent( from = NotFoundResponse.class)})
},
security = {
@OpenApiSecurity(name = "bearerAuth")
}
)
public void getOne(Context ctx, String locationName){
Expand Down Expand Up @@ -97,11 +100,17 @@ public void create(Context ctx){
}

@OpenApi(
security = {
@OpenApiSecurity(name = "bearerAuth")
},
tags = {"TimeSeries"}
)
public void update(Context ctx, String locationName){ throw new UnsupportedOperationException("not implemented yet"); }

@OpenApi(
security = {
@OpenApiSecurity(name = "bearerAuth")
},
tags = {"TimeSeries"}
)
public void delete(Context ctx , String locationName){ throw new UnsupportedOperationException("not implemented yet"); }
Expand Down

0 comments on commit 284cdfb

Please sign in to comment.