Skip to content

Add 'isFormStyle', 'isSpaceDelimited', and 'isPipeDelimited' flags to CodegenParameter #21240

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -31,7 +31,8 @@
public class CodegenParameter implements IJsonSchemaValidationProperties {
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
isCookieParam, isBodyParam, isContainer,
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue;
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue,
isFormStyle, isSpaceDelimited, isPipeDelimited;
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style;

Expand Down Expand Up @@ -268,6 +269,9 @@ public CodegenParameter copy() {
output.isExplode = this.isExplode;
output.style = this.style;
output.isDeepObject = this.isDeepObject;
output.isFormStyle = this.isFormStyle;
output.isSpaceDelimited = this.isSpaceDelimited;
output.isPipeDelimited = this.isPipeDelimited;
output.isMatrix = this.isMatrix;
output.isAllowEmptyValue = this.isAllowEmptyValue;
output.contentType = this.contentType;
Expand All @@ -282,6 +286,7 @@ public int hashCode() {
paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description,
unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue,
enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples,
isFormStyle, isSpaceDelimited, isPipeDelimited,
jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal,
isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword,
isFreeFormObject, isAnyType, isArray, isMap, isOptional, isFile, isEnum, isEnumRef, _enum, allowableValues,
Expand Down Expand Up @@ -375,6 +380,9 @@ public boolean equals(Object o) {
Objects.equals(enumName, that.enumName) &&
Objects.equals(style, that.style) &&
Objects.equals(isDeepObject, that.isDeepObject) &&
Objects.equals(isFormStyle, that.isFormStyle) &&
Objects.equals(isSpaceDelimited, that.isSpaceDelimited) &&
Objects.equals(isPipeDelimited, that.isPipeDelimited) &&
Objects.equals(isMatrix, that.isMatrix) &&
Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) &&
Objects.equals(example, that.example) &&
Expand Down Expand Up @@ -440,6 +448,9 @@ public String toString() {
sb.append(", enumName='").append(enumName).append('\'');
sb.append(", style='").append(style).append('\'');
sb.append(", deepObject='").append(isDeepObject).append('\'');
sb.append(", isFormStyle='").append(isFormStyle).append('\'');
sb.append(", isSpaceDelimited='").append(isSpaceDelimited).append('\'');
sb.append(", isPipeDelimited='").append(isPipeDelimited).append('\'');
sb.append(", isMatrix='").append(isMatrix).append('\'');
sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\'');
sb.append(", example='").append(example).append('\'');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,9 @@ public void setParameterEncodingValues(CodegenParameter codegenParameter, MediaT
}

codegenParameter.style = style.toString();
codegenParameter.isFormStyle = Encoding.StyleEnum.FORM == style;
codegenParameter.isSpaceDelimited = Encoding.StyleEnum.SPACE_DELIMITED == style;
codegenParameter.isPipeDelimited = Encoding.StyleEnum.PIPE_DELIMITED == style;
codegenParameter.isDeepObject = Encoding.StyleEnum.DEEP_OBJECT == style;

if (codegenParameter.isContainer) {
Expand Down Expand Up @@ -5286,6 +5289,9 @@ public CodegenParameter fromParameter(Parameter parameter, Set<String> imports)
if (parameter.getStyle() != null) {
codegenParameter.style = parameter.getStyle().toString();
codegenParameter.isDeepObject = Parameter.StyleEnum.DEEPOBJECT == parameter.getStyle();
codegenParameter.isFormStyle = Parameter.StyleEnum.FORM == parameter.getStyle();
codegenParameter.isSpaceDelimited = Parameter.StyleEnum.SPACEDELIMITED == parameter.getStyle();
codegenParameter.isPipeDelimited = Parameter.StyleEnum.PIPEDELIMITED == parameter.getStyle();
codegenParameter.isMatrix = Parameter.StyleEnum.MATRIX == parameter.getStyle();
}

Expand Down