use of org.wildfly.swarm.microprofile.openapi.api.models.security.OAuthFlowsImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiParser method readOAuthFlows.
/**
* Reads a {@link OAuthFlows} OpenAPI node.
* @param node
*/
private OAuthFlows readOAuthFlows(JsonNode node) {
if (node == null || !node.isObject()) {
return null;
}
OAuthFlowsImpl model = new OAuthFlowsImpl();
model.setImplicit(readOAuthFlow(node.get(OpenApiConstants.PROP_IMPLICIT)));
model.setPassword(readOAuthFlow(node.get(OpenApiConstants.PROP_PASSWORD)));
model.setClientCredentials(readOAuthFlow(node.get(OpenApiConstants.PROP_CLIENT_CREDENTIALS)));
model.setAuthorizationCode(readOAuthFlow(node.get(OpenApiConstants.PROP_AUTHORIZATION_CODE)));
readExtensions(node, model);
return model;
}
use of org.wildfly.swarm.microprofile.openapi.api.models.security.OAuthFlowsImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiAnnotationScanner method readOAuthFlows.
/**
* Reads an OAuthFlows annotation into a model.
* @param value
*/
private OAuthFlows readOAuthFlows(AnnotationValue value) {
if (value == null) {
return null;
}
LOG.debug("Processing a single @OAuthFlows annotation.");
AnnotationInstance annotation = value.asNested();
OAuthFlows flows = new OAuthFlowsImpl();
flows.setImplicit(readOAuthFlow(annotation.value(OpenApiConstants.PROP_IMPLICIT)));
flows.setPassword(readOAuthFlow(annotation.value(OpenApiConstants.PROP_PASSWORD)));
flows.setClientCredentials(readOAuthFlow(annotation.value(OpenApiConstants.PROP_CLIENT_CREDENTIALS)));
flows.setAuthorizationCode(readOAuthFlow(annotation.value(OpenApiConstants.PROP_AUTHORIZATION_CODE)));
return flows;
}
Aggregations