Java Code Examples for io.swagger.v3.oas.models.parameters.Parameter#setExplode()

The following examples show how to use io.swagger.v3.oas.models.parameters.Parameter#setExplode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenericParameterBuilder.java    From springdoc-openapi with Apache License 2.0 5 votes vote down vote up
/**
 * Sets parameter explode.
 *
 * @param parameter the parameter
 * @param p the p
 */
private void setParameterExplode(Parameter parameter, io.swagger.v3.oas.annotations.Parameter p) {
	if (isExplodable(p)) {
		if (Explode.TRUE.equals(p.explode())) {
			parameter.setExplode(Boolean.TRUE);
		}
		else if (Explode.FALSE.equals(p.explode())) {
			parameter.setExplode(Boolean.FALSE);
		}
	}
}
 
Example 2
Source File: GenericParameterBuilder.java    From springdoc-openapi with Apache License 2.0 4 votes vote down vote up
/**
 * Merge parameter.
 *
 * @param paramCalcul the param calcul
 * @param paramDoc the param doc
 */
private static void mergeParameter(Parameter paramCalcul, Parameter paramDoc) {
	if (StringUtils.isBlank(paramDoc.getDescription()))
		paramDoc.setDescription(paramCalcul.getDescription());

	if (StringUtils.isBlank(paramDoc.getIn()))
		paramDoc.setIn(paramCalcul.getIn());

	if (paramDoc.getExample() == null)
		paramDoc.setExample(paramCalcul.getExample());

	if (paramDoc.getDeprecated() == null)
		paramDoc.setDeprecated(paramCalcul.getDeprecated());

	if (paramDoc.getRequired() == null)
		paramDoc.setRequired(paramCalcul.getRequired());

	if (paramDoc.getAllowEmptyValue() == null)
		paramDoc.setAllowEmptyValue(paramCalcul.getAllowEmptyValue());

	if (paramDoc.getAllowReserved() == null)
		paramDoc.setAllowReserved(paramCalcul.getAllowReserved());

	if (StringUtils.isBlank(paramDoc.get$ref()))
		paramDoc.set$ref(paramDoc.get$ref());

	if (paramDoc.getSchema() == null)
		paramDoc.setSchema(paramCalcul.getSchema());

	if (paramDoc.getExamples() == null)
		paramDoc.setExamples(paramCalcul.getExamples());

	if (paramDoc.getExtensions() == null)
		paramDoc.setExtensions(paramCalcul.getExtensions());

	if (paramDoc.getStyle() == null)
		paramDoc.setStyle(paramCalcul.getStyle());

	if (paramDoc.getExplode() == null)
		paramDoc.setExplode(paramCalcul.getExplode());
}