use of org.eclipse.microprofile.openapi.models.servers.ServerVariables in project wildfly-swarm by wildfly-swarm.
the class OpenApiAnnotationScanner method readServerVariables.
/**
* Reads an array of ServerVariable annotations, returning a new {@link ServerVariables} model. The
* annotation value is an array of ServerVariable annotations.
* @param value
* @return
*/
private ServerVariables readServerVariables(AnnotationValue serverVariableAnnos) {
if (serverVariableAnnos == null) {
return null;
}
LOG.debug("Processing an array of @ServerVariable annotations.");
AnnotationInstance[] nestedArray = serverVariableAnnos.asNestedArray();
ServerVariables variables = new ServerVariablesImpl();
for (AnnotationInstance serverVariableAnno : nestedArray) {
String name = JandexUtil.stringValue(serverVariableAnno, OpenApiConstants.PROP_NAME);
if (name != null) {
variables.addServerVariable(name, readServerVariable(serverVariableAnno));
}
}
return variables;
}
Aggregations