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

fix: fix typos and other issues in jans-config-api swagger specs #1665 #1668

Merged
merged 1 commit into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class AttributeNames {
public static final String SCOPES = "scopes";
public static final String GRANT_TYPES = "grant types";
public static final String DATA_TYPE = "dataType";
public static final String REDIRECT_URIS = "redirectUris";

private AttributeNames() {
}
Expand Down
13 changes: 7 additions & 6 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +1892,8 @@ paths:
post:
tags:
- OAuth - OpenID Connect - Clients
summary: Create new OpenId connect client
description: Create new OpenId connect client
summary: Create new OpenId Connect client
description: Create new OpenId Connect client
operationId: post-oauth-openid-clients
requestBody:
content:
Expand Down Expand Up @@ -5048,10 +5048,7 @@ components:
description: Client.
type: object
required:
- applicationType
- logout
- includeClaimsInIdToken
- displayName
- redirectUris
properties:
dn:
type: string
Expand Down Expand Up @@ -6061,6 +6058,10 @@ components:
properties:
month:
type: integer
start_month:
type: integer
end_month:
type: integer
monthly_active_users:
type: integer
format: int64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public Response createOpenIdConnect(@Valid Client client) throws EncryptionExcep
inum = inumService.generateClientInum();
client.setClientId(inum);
}
checkNotNull(client.getDisplayName(), AttributeNames.DISPLAY_NAME);
checkNotNull(client.getRedirectUris(), AttributeNames.REDIRECT_URIS);

//scope validation
checkScopeFormat(client);
Expand Down Expand Up @@ -148,7 +148,7 @@ public Response updateClient(@Valid Client client) throws EncryptionException {
}
String inum = client.getClientId();
checkNotNull(inum, AttributeNames.INUM);
checkNotNull(client.getDisplayName(), AttributeNames.DISPLAY_NAME);
checkNotNull(client.getRedirectUris(), AttributeNames.REDIRECT_URIS);
Client existingClient = clientService.getClientByInum(inum);
checkResourceNotNull(existingClient, OPENID_CONNECT_CLIENT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class StatResource extends ConfigBaseResource {
@Produces(MediaType.APPLICATION_JSON)
public Response getStatistics(@HeaderParam("Authorization") String authorization,
@QueryParam(value = "month") String month,
@QueryParam(value = "start-month") String startMonth,
@QueryParam(value = "end-month") String endMonth,
@QueryParam(value = "start_month") String startMonth,
@QueryParam(value = "end_month") String endMonth,
@QueryParam(value = "format") String format) {
if (StringUtils.isBlank(format)) {
format = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public static void checkNotNull(String attribute, String attributeName) {
}
}

public static void checkNotNull(String[] attributes, String attributeName) {
if (attributes == null || attributes.length <= 0) {
throw new BadRequestException(getMissingAttributeError(attributeName));
}
}

public static void throwMissingAttributeError(String attributeName) {
if (StringUtils.isNotEmpty(attributeName)) {
throw new BadRequestException(getMissingAttributeError(attributeName));
Expand Down