@@ -570,7 +570,11 @@ public String toOperationId(String operationId) {
570570 */
571571 @ Override
572572 public String getTypeDeclaration (Schema p ) {
573- if (ModelUtils .isArraySchema (p )) {
573+ if (ModelUtils .isAnyType (p )) {
574+ return "any()" ;
575+ } else if (ModelUtils .isFreeFormObject (p , null )) {
576+ return "%{optional(String.t) => any()}" ;
577+ } else if (ModelUtils .isArraySchema (p )) {
574578 Schema inner = ModelUtils .getSchemaItems (p );
575579 return "[" + getTypeDeclaration (inner ) + "]" ;
576580 } else if (ModelUtils .isMapSchema (p )) {
@@ -856,6 +860,10 @@ private String normalizeTypeName(String baseType, boolean isPrimitive) {
856860 private void buildTypespec (CodegenParameter param , StringBuilder sb ) {
857861 if (param .dataType == null ) {
858862 sb .append ("nil" );
863+ } else if (param .isAnyType ) {
864+ sb .append ("any()" );
865+ } else if (param .isFreeFormObject ) {
866+ sb .append ("%{optional(String.t) => any()}" );
859867 } else if (param .isArray ) {
860868 // list(<subtype>)
861869 sb .append ("list(" );
@@ -875,6 +883,10 @@ private void buildTypespec(CodegenProperty property, StringBuilder sb) {
875883 if (property == null ) {
876884 LOGGER .error (
877885 "CodegenProperty cannot be null. Please report the issue to https://github.com/openapitools/openapi-generator with the spec" );
886+ } else if (property .isAnyType ) {
887+ sb .append ("any()" );
888+ } else if (property .isFreeFormObject ) {
889+ sb .append ("%{optional(String.t) => any()}" );
878890 } else if (property .isArray ) {
879891 sb .append ("list(" );
880892 buildTypespec (property .items , sb );
0 commit comments