Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter

Overview

Swagger dart code generator

Code partially generated with chopper

📣 Build dart types from Swagger/OpenAPI schemas

pub package GitHub issues GitHub last commit build Discord codecov Discord

SwaggerDartCodeGenerator is a code generator that looks for *.swagger files and builds .swagger.dart files, based on the schema. Code generation based on Chopper and JsonAnnotation models and can be configured for your needs.


Overview

In general case for each .swagger file three outputs will be created.
.dart generated by Swagger dart code generator, contains all models, requests, converters, etc.
[Since v1.2.0] .enums.dart generated by Swagger dart code generator, contains all enums and enums mappings.
.chopper.dart - generated by chopper.
.g.dart - generated by json_serializable.

Bloc

Installation

The generated code uses the following packages in run-time:

dependencies:
  chopper: ^4.0.1
  json_annotation: ^4.1.0

Add the following to your pubspec.yaml file to be able to do code generation:

dev_dependencies:
  build_runner: ^2.1.4
  chopper_generator: ^4.0.2
  json_serializable: ^5.0.0
  swagger_dart_code_generator: any

Then run:

pub packages get

or

flutter packages get

Now SwaggerGenerator will generate the API files for you by running:

pub run build_runner build

or

flutter pub run build_runner build

Configuration

Swagger generator offers some configuration options to generate code. All options should be included on build.yaml file on the root of the project:

targets:
  $default:
    builders:
      swagger_dart_code_generator:
        options:
          # custom configuration options!
Option Default value Is required Description
use_inheritance true false Enables and disables extends keyword.
with_base_url true false If this option is false, generator will ignore base url in swagger file.
use_required_attribute_for_headers true false If this option is false, generator will not add @required attribute to headers.
with_converter true false If option is true, combination of all mappings will be generated.
ignore_headers false false If option is true, headers will not be generated.
enums_case_sensitive true false If value is false, 'enumValue' will be defined like Enum.enumValue even it's json key equals 'ENUMVALUE'
include_paths [] false List of Regex If not empty - includes only paths matching reges
exclude_paths [] false List of Regex If not empty -exclude paths matching reges
use_default_null_for_lists false false If option is true, default value for lists will be null, otherwise - []
build_only_models false false If option is true, chopper classes will not be generated.
separate_models false false If option true, generates models into separate file.
include_if_null null false Sets includeIfNull JsonAnnotation feature and sets value for it. If null - not set anything.
default_values_map [] false Contains map of types and theirs default values. See DefaultValueMap.
response_override_value_map [] false Contains map of responses and theirs overridden values. See ResponseOverrideValueMap.
input_folder - true Path to folder with .swagger files (for ex. swagger_examples, or lib/swaggers).
output_folder - true Path to output folder (for ex. lib/generated).

It's important to remember that, by default, build will follow Dart's package layout conventions, meaning that only some folders will be considered to parse the input files. So, if you want to reference files from a folder other than lib/, make sure you've included it on sources:

targets:
  $default:
    sources:
      - lib/**
      - swagger_examples/**
      - swaggers/**

Default Value Map for model generation

If you want to add defaultValue: attribute to fields with concrete type you can use default value map. Please see next example:

targets:
  $default:
    builders:
      swagger_dart_code_generator:
        options:
          input_folder: 'lib/swaggers'
          output_folder: 'lib/generated_code/'
          default_values_map:
            - type_name: int
              default_value: '36'
            - type_name: String
              default_value: 'default'
            - type_name: 'List<String>'
              default_value: '[]'
          exclude_paths:
            - '\/cars\/get'
          include_paths:
            - '\/popular\/cars'

Response Override Value Map for requests generation

If you want to override response for concrete request, you can use response_override_value_map. For example:

targets:
  $default:
    builders:
      swagger_dart_code_generator:
        options:
          input_folder: 'lib/swaggers'
          output_folder: 'lib/generated_code/'
          response_override_value_map:
            - url: '/store/inventory'
              method: get
              overridden_value: 'List<dynamic>'
              - url: '/news/latest'
              method: put
              overridden_value: 'MyPerfectType'

Check the examples to see how to use it in details.

Comments
  • [BUG] Generated code handling records with more than 30 fields fails silently.

    [BUG] Generated code handling records with more than 30 fields fails silently.

    Describe the bug After adding some fields to a (working) record, the generated code fails out of the blue. It fails silently with no error casting or reason. Code generation seems ok (no significant warnings or errors). I have pinpointed the failing reason in the swagger file to be when a record contains more than 30 fields, then the generated code will not return anything from that record.

    To Reproduce Working swagger code

    {
      "openapi": "3.0.1",
      "info": {
        "title": "MOrdreAPI",
        "version": "637744809542676228"
      },
      "paths": {
        "/FileIO/firms/{frmNo}/orders/{ordNo}/note": {
          "get": {
            "tags": [
              "FileIO"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "ordNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "noteNm",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              },
              {
                "name": "hash",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/FileIO/firms/{frmNo}/orders/{ordNo}/orderlines/{lnNo}/note": {
          "get": {
            "tags": [
              "FileIO"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "ordNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "lnNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "noteNm",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              },
              {
                "name": "hash",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/textTypes": {
          "get": {
            "tags": [
              "Order"
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firmCountries": {
          "get": {
            "tags": [
              "Order"
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "ctry",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/texts": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "txtTp",
                "in": "query",
                "schema": {
                  "$ref": "#/components/schemas/TextTp"
                }
              },
              {
                "name": "lang",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/units": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/products": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/products/{prodNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "prodNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices/{rNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "rNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/sections": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "r10",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/sections/{rNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "rNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/customers/{custNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "custNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/actors/{actNo}/deliveryAddresses": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "actNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/actors/{actNo}/contactPersons": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "actNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices/{r10}/work": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "r10",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "components": {
        "schemas": {
          "ActorContactPerson": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "ActorContactPersonIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ActorContactPerson"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "ActorCustomer": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                 "type": "integer",
                 "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              },
              "custNo": {
                "type": "integer",
                "format": "int32"
              },
              "crSusp": {
                "type": "integer",
                "format": "int32"
              }
            },
            "additionalProperties": false
          },
          "ActorCustomerResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/ActorCustomer"
              }
            },
            "additionalProperties": false
          },
          "ActorDeliveryAddress": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "ActorDeliveryAddressIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ActorDeliveryAddress"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Frm": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "FrmIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Frm"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Int32IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Ord": {
            "type": "object",
            "properties": {
              "frmNo":{
                "type": "integer",
                "format": "int32"
              },
              "ordNo": {
                "type": "integer",
                "format": "int32"
              },
              "r1": {
                "type": "string",
                "nullable": true
              },
              "r2": {
                "type": "string",
                "nullable": true
              },
              "r10": {
                "type": "string",
                "nullable": true
              },
              "r11": {
                "type": "string",
                "nullable": true
              },
              "empNo": {
                "type": "integer",
                "format": "int32"
              },
              "rsp": {
                "type": "integer",
                "format": "int32"
              },
              "custNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "delAd1": {
                "type": "string",
                "nullable": true
              },
              "delAd2": {
                "type": "string",
                "nullable": true
              },
              "delAd4": {
                "type": "string",
                "nullable": true
              },
              "delPArea": {
                "type": "string",
                "nullable": true
              },
              "cfDelDt": {
                "type": "integer",
                "format": "int32"
              },
              "gr": {
                "type": "integer",
                "format": "int32"
              },
              "gr2": {
                "type": "integer",
                "format": "int32"
              },
              "gr6": {
                "type": "integer",
                "format": "int32"
              },
              "ourRef": {
                "type": "string",
                "nullable": true
              },
              "yrRef": {
                "type": "string",
                "nullable": true
              },
              "csOrdNo": {
                "type": "string",
                "nullable": true
              },
              "label": {
                "type": "string",
                "nullable": true
              },
              "inf": {
                "type": "string",
                "nullable": true
              },
              "inf2": {
                "type": "string",
                "nullable": true
              },
              "inf3": {
                "type": "string",
                "nullable": true
              },
              "inf4": {
                "type": "string",
                "nullable": true
              },
              "inf5": {
                "type": "string",
                "nullable": true
              },
              "inf6": {
                "type": "string",
                "nullable": true
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "OrdLn": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "ordNo": {
                "type": "integer",
                "format": "int32"
              },
              "lnNo": {
                "type": "integer",
                "format": "int32"
              },
              "prodNo": {
                "type": "string",
                "nullable": true
              },
              "descr": {
                "type": "string",
                "nullable": true
              },
              "r1": {
                "type": "integer",
                "format": "int32"
              },
              "cfDelDt": {
                "type": "integer",
                "format": "int32"
              },
              "durDt": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "Prod": {
            "type": "object",
            "properties": {
              "prodNo": {
                "type": "string",
                "nullable": true
              },
              "descr": {
                "type": "string",
                "nullable": true
              },
              "prodTp3": {
                "type": "integer",
                "format": "int32"
              },
              "prodGr": {
                "type": "integer",
                "format": "int32"
              },
              "prodPrG2": {
                "type": "integer",
                "format": "int32"
              },
              "stSaleUn": {
                "type": "integer",
                "format": "int32"
              },
              "webPg2": {
                "type": "string",
                "nullable": true
              },
              "r3": {
                "type": "integer",
                "format": "int32"
              },
              "r4": {
                "type": "integer",
                "format": "int32"
              },
              "procMt": {
                "type": "integer",
                "format": "int32"
              },
              "excPrint": {
                "type": "integer",
                "format": "int32"
              },
              "editPref": {
                "type": "integer",
                "format": "int32"
              },
              "edFmt": {
                "type": "integer",
                "format": "int32"
              },
              "specFunc": {
                "type": "integer",
                "format": "int32"
              }
            },
            "additionalProperties": false
          },
          "ProdIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Prod"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "ProdResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/Prod"
              }
            },
            "additionalProperties": false
          },
          "R1": {
            "type": "object",
            "properties": {
              "rNo": {
                "type": "integer",
                "format": "int32"
              },
              "r10": {
                "type": "string",
                "nullable": true
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R10": {
            "type": "object",
            "properties": {
              "rNo": {
                "type": "string",
                "nullable": true
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R10IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/R10"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R1IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/R1"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R1Result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/R1"
              }
            },
            "additionalProperties": false
          },
          "StringInt32IDictionaryResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int32"
                },
                "nullable": true
              }
              },
              "additionalProperties": false
            },
            "StringResult": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
            },
          "TextTp": {
            "enum": [
              16,
              21,
              48,
              53
            ],
            "type": "integer",
            "format": "int32"
          },
          "Txt": {
            "type": "object",
            "properties": {
              "txtNo": {
                "type": "integer",
                "format": "int32"
              },
              "txt": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "TxtIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Txt"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Unit": {
            "type": "object",
            "properties": {
              "un": {
                "type": "integer",
                "format": "int32"
              },
              "descr": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "UnitIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Unit"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Work": {
            "type": "object",
            "properties": {
              "ords": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Ord"
                },
                "nullable": true
              },
              "ordLns": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OrdLn"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "WorkResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/Work"
              }
            },
            "additionalProperties": false
          }
        }
      }
    }
    

    Failing swagger code:

    {
      "openapi": "3.0.1",
      "info": {
        "title": "MOrdreAPI",
        "version": "637747295269157904"
      },
      "paths": {
        "/FileIO/firms/{frmNo}/orders/{ordNo}/note": {
          "get": {
            "tags": [
              "FileIO"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "ordNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "noteNm",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              },
              {
                "name": "hash",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/FileIO/firms/{frmNo}/orders/{ordNo}/orderlines/{lnNo}/note": {
          "get": {
            "tags": [
              "FileIO"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "ordNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "lnNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "noteNm",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              },
              {
                "name": "hash",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/textTypes": {
          "get": {
            "tags": [
              "Order"
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/StringInt32IDictionaryResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firmCountries": {
          "get": {
            "tags": [
              "Order"
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/Int32IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "ctry",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/FrmIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/texts": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "txtTp",
                "in": "query",
                "schema": {
                  "$ref": "#/components/schemas/TextTp"
                }
              },
              {
                "name": "lang",
                "in": "query",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/TxtIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/units": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/UnitIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/products": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/products/{prodNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "prodNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ProdResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices/{rNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "rNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R10IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/sections": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "r10",
                "in": "query",
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1IEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/sections/{rNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "rNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/R1Result"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/customers/{custNo}": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "custNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorCustomerResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/actors/{actNo}/deliveryAddresses": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "actNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorDeliveryAddressIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/actors/{actNo}/contactPersons": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "actNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/ActorContactPersonIEnumerableResult"
                    }
                  }
                }
              }
            }
          }
        },
        "/Order/firms/{frmNo}/offices/{r10}/work": {
          "get": {
            "tags": [
              "Order"
            ],
            "parameters": [
              {
                "name": "frmNo",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              },
              {
                "name": "r10",
                "in": "path",
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            ],
            "responses": {
              "200": {
                "description": "Success",
                "content": {
                  "text/plain": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  },
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  },
                  "text/json": {
                    "schema": {
                      "$ref": "#/components/schemas/WorkResult"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "components": {
        "schemas": {
          "ActorContactPerson": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "ActorContactPersonIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ActorContactPerson"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "ActorCustomer": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              },
              "custNo": {
                "type": "integer",
                "format": "int32"
              },
              "crSusp": {
                "type": "integer",
                "format": "int32"
              }
            },
            "additionalProperties": false
          },
          "ActorCustomerResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/ActorCustomer"
              }
            },
            "additionalProperties": false
          },
          "ActorDeliveryAddress": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "actNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ad1": {
                "type": "string",
                "nullable": true
              },
              "ad2": {
                "type": "string",
                "nullable": true
              },
              "ad4": {
                "type": "string",
                "nullable": true
              },
              "pNo": {
                "type": "string",
                "nullable": true
              },
              "pArea": {
                "type": "string",
                "nullable": true
              },
              "mobPh": {
                "type": "string",
                "nullable": true
              },
              "phone": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "ActorDeliveryAddressIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ActorDeliveryAddress"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Frm": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "FrmIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Frm"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Int32IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Ord": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "ordNo": {
                "type": "integer",
                "format": "int32"
              },
              "r1": {
                "type": "string",
                "nullable": true
              },
              "r2": {
                "type": "string",
                "nullable": true
              },
              "r10": {
                "type": "string",
                "nullable": true
              },
              "r11": {
                "type": "string",
                "nullable": true
              },
              "empNo": {
                "type": "integer",
                "format": "int32"
              },
              "rsp": {
                "type": "integer",
                "format": "int32"
              },
              "custNo": {
                "type": "integer",
                "format": "int32"
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "ctry": {
                "type": "integer",
                "format": "int32"
              },
              "delAd1": {
                "type": "string",
                "nullable": true
              },
              "delAd2": {
                "type": "string",
                "nullable": true
              },
              "delAd4": {
                "type": "string",
                "nullable": true
              },
              "delPArea": {
                "type": "string",
                "nullable": true
              },
              "cfDelDt": {
                "type": "integer",
                "format": "int32"
              },
              "gr": {
                "type": "integer",
                "format": "int32"
              },
              "gr2": {
                "type": "integer",
                "format": "int32"
              },
              "gr6": {
                "type": "integer",
                "format": "int32"
              },
              "ourRef": {
                "type": "string",
                "nullable": true
              },
              "yrRef": {
                "type": "string",
                "nullable": true
              },
              "csOrdNo": {
                "type": "string",
                "nullable": true
              },
              "label": {
                "type": "string",
                "nullable": true
              },
              "inf": {
                "type": "string",
                "nullable": true
              },
              "inf2": {
                "type": "string",
                "nullable": true
              },
              "inf3": {
                "type": "string",
                "nullable": true
              },
              "inf4": {
                "type": "string",
                "nullable": true
              },
              "inf5": {
                "type": "string",
                "nullable": true
              },
              "inf6": {
                "type": "string",
                "nullable": true
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "OrdLn": {
            "type": "object",
            "properties": {
              "frmNo": {
                "type": "integer",
                "format": "int32"
              },
              "ordNo": {
                "type": "integer",
                "format": "int32"
              },
              "lnNo": {
                "type": "integer",
                "format": "int32"
              },
              "prodNo": {
                "type": "string",
                "nullable": true
              },
              "descr": {
                "type": "string",
                "nullable": true
              },
              "r1": {
                "type": "integer",
                "format": "int32"
              },
              "cfDelDt": {
                "type": "integer",
                "format": "int32"
              },
              "durDt": {
                "type": "integer",
                "format": "int32"
              },
              "noteNm": {
                "type": "string",
                "nullable": true
              },
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
            },
            "additionalProperties": false
          },
          "Prod": {
            "type": "object",
            "properties": {
              "prodNo": {
                "type": "string",
                "nullable": true
              },
              "descr": {
                "type": "string",
                "nullable": true
              },
              "prodTp3": {
                "type": "integer",
                "format": "int32"
              },
              "prodGr": {
                "type": "integer",
                "format": "int32"
              },
              "prodPrG2": {
                "type": "integer",
                "format": "int32"
              },
              "stSaleUn": {
                "type": "integer",
                "format": "int32"
              },
              "webPg2": {
                "type": "string",
                "nullable": true
              },
              "r3": {
                "type": "integer",
                "format": "int32"
              },
              "r4": {
                "type": "integer",
                "format": "int32"
              },
              "procMt": {
                "type": "integer",
                "format": "int32"
              },
              "excPrint": {
                "type": "integer",
                "format": "int32"
              },
              "editPref": {
                "type": "integer",
                "format": "int32"
              },
              "edFmt": {
                "type": "integer",
                "format": "int32"
              },
              "specFunc": {
                "type": "integer",
                "format": "int32"
              }
            },
            "additionalProperties": false
          },
          "ProdIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Prod"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "ProdResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/Prod"
              }
            },
            "additionalProperties": false
          },
          "R1": {
            "type": "object",
            "properties": {
              "rNo": {
                "type": "integer",
                "format": "int32"
              },
              "r10": {
                "type": "string",
                "nullable": true
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R10": {
            "type": "object",
            "properties": {
              "rNo": {
                "type": "string",
                "nullable": true
              },
              "nm": {
                "type": "string",
                "nullable": true
              },
              "mailAd": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R10IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/R10"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R1IEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/R1"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "R1Result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/R1"
              }
            },
            "additionalProperties": false
          },
          "StringInt32IDictionaryResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int32"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "StringResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "TextTp": {
            "enum": [
              16,
              21,
              48,
              53
            ],
            "type": "integer",
            "format": "int32"
          },
          "Txt": {
            "type": "object",
            "properties": {
              "txtNo": {
                "type": "integer",
                "format": "int32"
              },
              "txt": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "TxtIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Txt"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Unit": {
            "type": "object",
            "properties": {
              "un": {
                "type": "integer",
                "format": "int32"
              },
              "descr": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "UnitIEnumerableResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Unit"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "Work": {
            "type": "object",
            "properties": {
              "ords": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Ord"
                },
                "nullable": true
              },
              "ordLns": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OrdLn"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "WorkResult": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "nullable": true
              },
              "data": {
                "$ref": "#/components/schemas/Work"
              }
            },
            "additionalProperties": false
          }
        }
      }
    }
    

    The only difference between those two is in line 1241 to 1246 in the non-working one:

                    ,
              "noteHash": {
                "type": "integer",
                "format": "int64",
                "nullable": true,
                "readOnly": true
              }
    

    where that section is omitted in the working swagger file, and is the 31'st field in that Ord record.

    Expected behavior Read the data as the working one

    Library version used: pubspec.yaml:

    name: mwork
    description: A new Flutter project.
    
    # The following line prevents the package from being accidentally published to
    # pub.dev using `flutter pub publish`. This is preferred for private packages.
    publish_to: 'none' # Remove this line if you wish to publish to pub.dev
    
    # The following defines the version and build number for your application.
    # A version number is three numbers separated by dots, like 1.2.43
    # followed by an optional build number separated by a +.
    # Both the version and the builder number may be overridden in flutter
    # build by specifying --build-name and --build-number, respectively.
    # In Android, build-name is used as versionName while build-number used as versionCode.
    # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
    # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
    # Read more about iOS versioning at
    # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
    version: 0.0.3+3
    
    environment:
      sdk: ">=2.15.0-116.0.dev <3.0.0"
    
    # Dependencies specify other packages that your package needs in order to work.
    # To automatically upgrade your package dependencies to the latest versions
    # consider running `flutter pub upgrade --major-versions`. Alternatively,
    # dependencies can be manually updated by changing the version numbers below to
    # the latest version available on pub.dev. To see which dependencies have newer
    # versions available, run `flutter pub outdated`.
    dependencies:
      msal_js: ^2.14.0
      aad_oauth: ^0.3.0
      provider: ^6.0.1
      path_to_regexp: ^0.4.0
      quiver: ^3.0.0
      introduction_screen: ^2.1.0
      intl: ^0.17.0
      socket_io_client: ^2.0.0-beta.4-nullsafety.0
      flutter:
        sdk: flutter
    
      #--jwt--- makes it possible to analyze jwt
    
      jwt_decode: ^0.3.1
    
      #---Swagger changes---
      chopper: ^4.0.4
      json_annotation: ^4.4.0
    
      #---Google Maps---
      google_maps_flutter: ^2.1.1
      google_maps_flutter_web: ^0.3.2
    
      #---Location data (GPS)---
      location: ^4.3.0
    
      #---Get---
      get: ^4.3.8
    
      #---Settings / preferences ---
      flutter_settings_screens: ^0.3.2-null-safety
    
      #---Camera function---
      camera: ^0.9.4+5
      path_provider: ^2.0.7
      path: ^1.8.0
    
      #---Floor functionality---
      floor: ^1.2.0
    
      #---Drift functionality---
      drift: ^1.0.1
      sqlite3_flutter_libs: ^0.5.0
    
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.2
    
    
    
    #---Icons---
    
    flutter_icons:
      android: "launcher_icon"
      ios: true
      image_path: "assets/icons/logo_round.png"
      adaptive_icon_background: "#666666"
    
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
    
      #---swagger changes---
      build_runner: ^2.1.5
      chopper_generator: ^4.0.3
      json_serializable: ^6.1.1
      swagger_dart_code_generator: ^2.2.7
    
      #---Launcher icons---
      flutter_launcher_icons: ^0.9.2
    
      #---floor generators---
      floor_generator: ^1.2.0
    
      #---drift generators---
      drift_dev: ^1.0.2
    
    
      # The "flutter_lints" package below contains a set of recommended lints to
      # encourage good coding practices. The lint set provided by the package is
      # activated in the `analysis_options.yaml` file located at the root of your
      # package. See that file for information about deactivating specific lint
      # rules and activating additional ones.
      flutter_lints: ^1.0.0
    
    # For information on the generic Dart part of this file, see the
    # following page: https://dart.dev/tools/pub/pubspec
    
    # The following section is specific to Flutter.
    flutter:
    
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
    
      # To add assets to your application, add an assets section, like this:
      assets:
        - assets/icons/
    
    
      # An image asset can refer to one or more resolution-specific "variants", see
      # https://flutter.dev/assets-and-images/#resolution-aware.
    
      # For details regarding adding assets from package dependencies, see
      # https://flutter.dev/assets-and-images/#from-packages
    
      # To add custom fonts to your application, add a fonts section here,
      # in this "flutter" section. Each entry in this list should have a
      # "family" key with the font family name, and a "fonts" key with a
      # list giving the asset and other descriptors for the font. For
      # example:
      # fonts:
      #   - family: Schyler
      #     fonts:
      #       - asset: fonts/Schyler-Regular.ttf
      #       - asset: fonts/Schyler-Italic.ttf
      #         style: italic
      #   - family: Trajan Pro
      #     fonts:
      #       - asset: fonts/TrajanPro.ttf
      #       - asset: fonts/TrajanPro_Bold.ttf
      #         weight: 700
      #
      # For details regarding fonts from package dependencies,
      # see https://flutter.dev/custom-fonts/#from-packages
    
    
    
    

    Additional context Add any other context about the problem here.

    bug 
    opened by RoarGronmo 31
  •  type 'YamlMap' is not a subtype of type 'bool?' in type cast

    type 'YamlMap' is not a subtype of type 'bool?' in type cast

    Can not run with this file. version : ^2.1.0-prerelease.3

    Swagger file

    link

    build.yaml

    targets: $default: sources: - lib/** - $package$ builders: swagger_dart_code_generator: options: with_base_url: true with_converter: true use_required_attribute_for_headers: true ignore_headers: true use_default_null_for_lists: false use_inheritance: false build_only_models: false use_path_for_request_names: false include_if_null: enabled: true value: false input_folder: "lib/" output_folder: "lib/services/generated_rest_service/" enums_case_sensitive: true default_values_map: - type_name: int default_value: "0" # response_override_value_map:

    Logs

    
    [INFO] Bootstrap:Precompiling build script......
    [FINE] Bootstrap:../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/swagger_root.g2.dart:20:12: Warning: Operand of null-aware operation '??' has type 'Map<String, SwaggerPath>' which excludes null.
     - 'Map' is from 'dart:core'.
     - 'SwaggerPath' is from 'package:swagger_dart_code_generator/src/swagger_models/swagger_path.dart' ('../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/swagger_path.dart').
        paths: _mapPaths(json['paths'] as Map<String, dynamic>) ?? {},
               ^
    ../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/swagger_components.g2.dart:21:16: Warning: Operand of null-aware operation '??' has type 'Map<String, SwaggerSchema>' which excludes null.
     - 'Map' is from 'dart:core'.
     - 'SwaggerSchema' is from 'package:swagger_dart_code_generator/src/swagger_models/responses/swagger_schema.dart' ('../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/responses/swagger_schema.dart').
        responses: mapResponses(json['responses'] as Map<String, dynamic>?) ?? {},
                   ^
    ../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/swagger_components.g2.dart:23:9: Warning: Operand of null-aware operation '??' has type 'Map<String, SwaggerSchema>' which excludes null.
     - 'Map' is from 'dart:core'.
     - 'SwaggerSchema' is from 'package:swagger_dart_code_generator/src/swagger_models/responses/swagger_schema.dart' ('../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/swagger_dart_code_generator-2.1.0-prerelease.3/lib/src/swagger_models/responses/swagger_schema.dart').
            mapResponses(json['requestBodies'] as Map<String, dynamic>?) ?? {},
            ^
    [INFO] Bootstrap:Precompiling build script... completed, took 7.3s
    
    [INFO] Bootstrap:There was output on stdout while precompiling the build  script, run with `--verbose` to see it (you will need to run a `clean` first to re-generate it).
    
    [FINE] Bootstrap:Core package locations file does not exist
    [SEVERE] swagger_dart_code_generator:swagger_dart_code_generator:
    
    type 'YamlMap' is not a subtype of type 'bool?' in type cast
    
    
    package:swagger_dart_code_generator/src/models/generator_options.g2.dart 42:44  _$GeneratorOptionsFromJson
    package:swagger_dart_code_generator/src/models/generator_options.dart 31:7      new GeneratorOptions.fromJson
    package:swagger_dart_code_generator/swagger_dart_code_generator.dart 47:32      new SwaggerDartCodeGenerator
    package:swagger_dart_code_generator/swagger_dart_code_generator.dart 10:5       swaggerCodeBuilder
    package:build_runner_core/src/package_graph/apply_builders.dart 179:47          new BuilderApplication.forBuilder.<fn>.<fn>.<fn>
    dart:async                                                                      runZonedGuarded
    package:build_runner_core/src/package_graph/apply_builders.dart 388:10          _scopeLogSync
    package:build_runner_core/src/package_graph/apply_builders.dart 179:13          new BuilderApplication.forBuilder.<fn>.<fn>
    package:build_runner_core/src/package_graph/apply_builders.dart 342:27          _createBuildPhasesForBuilderInCycle.<fn>.<fn>
    dart:core                                                                       Iterable.toList
    package:build_runner_core/src/package_graph/apply_builders.dart 289:8           createBuildPhases
    package:build_runner_core/src/generate/build_impl.dart 110:29                   BuildImpl.create
    package:build_runner_core/src/generate/build_runner.dart 34:42                  BuildRunner.create
    package:build_runner                                                            BuildCommand._run
    package:args/command_runner.dart 196:13                                         CommandRunner.runCommand
    package:build_runner                                                            run
    .dart_tool/build/entrypoint/build.dart 31:16                                    main
    
    [+22234 ms] "flutter run" took 22,318ms.
    
    
    [   +5 ms] pub finished with exit code 78
    [   +1 ms] 
               #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
               #1      _DefaultPub.interactively (package:flutter_tools/src/dart/pub.dart:366:7)
               <asynchronous suspension>
               #2      PackagesForwardCommand.runCommand (package:flutter_tools/src/commands/packages.dart:241:5)
               <asynchronous suspension>
               #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
               <asynchronous suspension>
               #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #5      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
               <asynchronous suspension>
               #6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
               <asynchronous suspension>
               #7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
               <asynchronous suspension>
               #9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
               <asynchronous suspension>
               #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #11     main (package:flutter_tools/executable.dart:91:3)
               <asynchronous suspension>
    
    opened by zhukeev 25
  • [BUG]Could not find factory for type XX

    [BUG]Could not find factory for type XX

    We are getting this error from all the object models from our API. Everything was working fine, we just regenerate de SPEC and all models have this specific error.

    Could not find factory for type Orders. Is 'Orders: Orders.fromJsonFactory' included in the CustomJsonDecoder instance creation in bootstrapper.dart? flutter: #0 $CustomJsonDecoder._decodeMap (package:simplr/data/api/simplr.swagger.dart:15423:14) #1 $CustomJsonDecoder.decode (package:simplr/data/api/simplr.swagger.dart:15414:14) #2 $JsonSerializableConverter.convertResponse (package:simplr/data/api/simplr.swagger.dart:15445:28) #3 ChopperClient._decodeResponse (package:chopper/src/base.dart:186:29) #4 ChopperClient._handleSuccessResponse (package:chopper/src/base.dart:260:17) #5 ChopperClient.send (package:chopper/src/base.dart:333:19)

    bug Triage needed 
    opened by alextarrago 23
  • [BUG] Multipart/form-data request is not being generated 🐛

    [BUG] Multipart/form-data request is not being generated 🐛

    Hi guys!

    Describe the bug We are generating our current specification and some of the services are not properly generated. All of the multipart/form-data services are being created as common @Post calls without any @PartFile attributes, leading us on not being able to use the generator for those services. Our spec is attached for your references (using OpenAPI 3.0).

    To Reproduce

     "/account/files": {
          "get": {
            "summary": "List all the user files",
            "operationId": "listFiles",
            "tags": [
              "Account"
            ],
            "responses": {
              "200": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/UserFiles"
                    }
                  }
                },
                "description": "An array of File"
              },
              "default": {
                "$ref": "#/components/responses/Problem"
              }
            }
          },
          "post": {
            "summary": "Uploads File",
            "description": "Empty description",
            "operationId": "uploadFile",
            "requestBody": {
              "content": {
                "multipart/form-data": {
                  "schema": {
                    "type": "object",
                    "required": [
                      "id",
                      "file"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "file": {
                        "type": "string",
                        "format": "binary"
                      }
                    }
                  }
                }
              },
              "required": true
            },
            "responses": {
              "default": {
                "$ref": "#/components/responses/Problem"
              }
            }
          }
        },
    

    Expected behavior The multipart request to be created properly.

    Library version used: 2.4.9

    Are we missing something?

    bug waiting customer response 
    opened by alextarrago 20
  • "You have hit a bug in build runner"

    Describe the bug ran: flutter pub run build_runner --delete-conflicting-outputs

    with swagger contents in c:\flutterprojects\m_work_sandbox_4_2\swaggers\m_work_api.swagger

    with following configs (see pubspec.yaml.txt): pubspec.yaml.txt

    and following swagger file( see m_work_api.swagger.txt): m_work_api.swagger.txt

    Note: the files above has .txt types because github won't allow .yaml and .swagger files to be uploaded.

    generates following message in powershell:

    PS C:\flutterprojects\m_work_sandbox_4_2> flutter pub run build_runner build --delete-conflicting-outputs
    [INFO] Generating build script...
    [INFO] Generating build script completed, took 401ms
    
    [INFO] Precompiling build script......
    [INFO] Precompiling build script... completed, took 6.1s
    
    
    
    You have hit a bug in build_runner
    Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
    
    
    Bad state: No element
    dart:core                                                                   Iterable.first
    package:swagger_dart_code_generator/swagger_dart_code_generator.dart 46:27  _generateExtensions
    package:swagger_dart_code_generator/swagger_dart_code_generator.dart 60:32  SwaggerDartCodeGenerator.buildExtensions
    package:build_runner_core/src/package_graph/apply_builders.dart 403:33      _validateBuilder
    package:build_runner_core/src/package_graph/apply_builders.dart 183:9       new BuilderApplication.forBuilder.<fn>.<fn>
    package:build_runner_core/src/package_graph/apply_builders.dart 346:27      _createBuildPhasesForBuilderInCycle.<fn>.<fn>
    dart:core                                                                   Iterable.toList
    package:build_runner_core/src/package_graph/apply_builders.dart 293:8       createBuildPhases
    package:build_runner_core/src/generate/build_impl.dart 109:29               BuildImpl.create
    package:build_runner_core/src/generate/build_runner.dart 34:42              BuildRunner.create
    package:build_runner/src/generate/build.dart 109:35                         build
    package:build_runner/src/entrypoint/build.dart 35:18                        BuildCommand._run
    package:args/command_runner.dart 209:13                                     CommandRunner.runCommand
    package:build_runner/src/entrypoint/run.dart 26:18                          run
    .dart_tool\build\entrypoint\build.dart 31:16                                main
    
    pub finished with exit code 1
    

    Expected behavior A clear and concise description of what you expected to happen.

    I expected files to be created

    Library version used:

    extract from pubspec.yaml

    dependencies:
    ...
       json_annotation: ^4.3.0
      chopper: ^4.0.3
    ...
    dev-dependencies:
    ...
      build_runner: ^2.1.2
      chopper_generator: ^4.0.3
      swagger_dart_code_generator: any
    ...
    
    targets:
      $default:
        sources:
          - swaggers/**
          - lib/**
        builders:
          chopper_generator:
            options:
              header: "//Generated code"
          swagger_dart_code_generator:
            options:
              input_folder: "lib/"
              output_folder: "lib/swagger_generated_code"
    

    Additional context Since the errormessage says I should file an error at dart-lang there, is it more likely that error resides here.

    bug 
    opened by RoarGronmo 16
  • [BUG]Could not find factory for type XX

    [BUG]Could not find factory for type XX

    upgrade version: 2.4.10 -> 2.6.0 We are getting this error:

    Error: Could not find factory for type AdCampaignGet$36Response. Is 'AdCampaignGet$36Response: AdCampaignGet$36Response.fromJsonFactory' included in the CustomJsonDecoder instance creation in bootstrapper.dart?

    check regenerate code is different: image generated new code lack generatedMapping.putIfAbsent.

    swagger file define like: /ad_campaign: get: parameters: - name: page in: query type: integer format: int32 default: 0 - name: size in: query type: integer format: int32 default: 20 maximum: 5000 responses: '200': description: ok schema: type: object required: - data properties: isFull: type: boolean data: type: array items: $ref: '#/definitions/adCampaign' pagination: $ref: '#/definitions/pagination' default: description: error schema: $ref: '#/definitions/error'

    bug Triage needed 
    opened by linbintie 15
  • [BUG] No output to defined result paths in `v2.4.3`, ok in `v2.4.2`.

    [BUG] No output to defined result paths in `v2.4.3`, ok in `v2.4.2`.

    Describe the bug When building with flutter pub run build_runner build --delete-conflicting-outputs with v2.4.3 there are no files generated in my result path defined in the build.yaml file.

    To Reproduce Here is the pubspec.yaml content:

    name: m_work_admin
    description: mWork admin module.
    
    # The following line prevents the package from being accidentally published to
    # pub.dev using `flutter pub publish`. This is preferred for private packages.
    publish_to: 'none' # Remove this line if you wish to publish to pub.dev
    
    # The following defines the version and build number for your application.
    # A version number is three numbers separated by dots, like 1.2.43
    # followed by an optional build number separated by a +.
    # Both the version and the builder number may be overridden in flutter
    # build by specifying --build-name and --build-number, respectively.
    # In Android, build-name is used as versionName while build-number used as versionCode.
    # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
    # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
    # Read more about iOS versioning at
    # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
    version: 1.0.0+1
    
    environment:
      sdk: ">=2.16.0-134.5.beta <3.0.0"
    
    # Dependencies specify other packages that your package needs in order to work.
    # To automatically upgrade your package dependencies to the latest versions
    # consider running `flutter pub upgrade --major-versions`. Alternatively,
    # dependencies can be manually updated by changing the version numbers below to
    # the latest version available on pub.dev. To see which dependencies have newer
    # versions available, run `flutter pub outdated`.
    dependencies:
      flutter:
        sdk: flutter
    
      # ---flutter settings screen
      flutter_settings_screens: ^0.3.2-null-safety
    
      # ---Microsoft Client Access
      msal_js: ^2.14.0
    
      # ---Bidirectional listview
      bidirectional_listview: ^1.0.3
      infinite_listview: ^1.1.0
    
      # ---Swagger changes
      chopper: ^4.0.5
      json_annotation: ^4.4.0
    
      #---linked_scroll_controller
      linked_scroll_controller: ^0.2.0
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.4
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
    
      # ---Swagger changes
      build_runner: ^2.1.7
      chopper_generator: ^4.0.5
      json_serializable: ^6.1.4
      swagger_dart_code_generator: 2.4.2
    
      # The "flutter_lints" package below contains a set of recommended lints to
      # encourage good coding practices. The lint set provided by the package is
      # activated in the `analysis_options.yaml` file located at the root of your
      # package. See that file for information about deactivating specific lint
      # rules and activating additional ones.
      flutter_lints: ^1.0.0
    
    # For information on the generic Dart part of this file, see the
    # following page: https://dart.dev/tools/pub/pubspec
    
    # The following section is specific to Flutter.
    flutter:
    
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
    
      # To add assets to your application, add an assets section, like this:
      # assets:
      #   - images/a_dot_burr.jpeg
      #   - images/a_dot_ham.jpeg
    
      # An image asset can refer to one or more resolution-specific "variants", see
      # https://flutter.dev/assets-and-images/#resolution-aware.
    
      # For details regarding adding assets from package dependencies, see
      # https://flutter.dev/assets-and-images/#from-packages
    
      # To add custom fonts to your application, add a fonts section here,
      # in this "flutter" section. Each entry in this list should have a
      # "family" key with the font family name, and a "fonts" key with a
      # list giving the asset and other descriptors for the font. For
      # example:
      # fonts:
      #   - family: Schyler
      #     fonts:
      #       - asset: fonts/Schyler-Regular.ttf
      #       - asset: fonts/Schyler-Italic.ttf
      #         style: italic
      #   - family: Trajan Pro
      #     fonts:
      #       - asset: fonts/TrajanPro.ttf
      #       - asset: fonts/TrajanPro_Bold.ttf
      #         weight: 700
      #
      # For details regarding fonts from package dependencies,
      # see https://flutter.dev/custom-fonts/#from-packages
    
    

    Here is the build.yaml content

    targets:
      $default:
        sources:
          - swaggers/**
          - lib/**
          - $package$
        builders:
          chopper_generator:
            options:
              header: "//Generated code"
          swagger_dart_code_generator:
            options:
              input_folder: "swaggers/"
              output_folder: "lib/services/api/generated"
    

    And here's the swagger file used (as a .txt file when github prohibits upload of rich content files):

    m_work_admin_api.swagger.txt

    Expected behavior The files should be generated in the specified path in the build.yaml file.

    Remedy Use v2.4.2 or lower...

    Flutter doctor --verbose

    C:\Flutter\flutter\bin\flutter.bat doctor --verbose
    [√] Flutter (Channel beta, 2.11.0-0.1.pre, on Microsoft Windows [Version 10.0.22000.493], locale nb-NO)
        • Flutter version 2.11.0-0.1.pre at C:\Flutter\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision b101bfe32f (2 weeks ago), 2022-02-16 07:36:54 -0800
        • Engine revision e355993572
        • Dart version 2.17.0 (build 2.17.0-69.2.beta)
        • DevTools version 2.10.0-dev.1
    
    [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
        • Android SDK at C:\Users\RoarGronmo\AppData\Local\Android\sdk
        • Platform android-Tiramisu, build-tools 32.1.0-rc1
        • Java binary at: C:\Program Files\Android Studio\Android Studio 2021.3.1.3\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        • Visual Studio Community 2019 version 16.11.31702.278
        • Windows 10 SDK version 10.0.19041.0
    
    [√] Android Studio (version 2020.3)
        • Android Studio at C:\Program Files\Android Studio\Android Studio 2020.3.1.26
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [√] Android Studio (version 2021.1)
        • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.1.1.22
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    
    [√] Android Studio (version 2021.1)
        • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.1.1.1
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [√] Android Studio (version 2021.2)
        • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.2.1.9
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    
    [√] Android Studio (version 2021.3)
        • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.3.1.3
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [√] Connected device (3 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.493]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 98.0.4758.102
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 98.0.1108.43
    
    [√] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    Process finished with exit code 0
    
    bug Triage needed 
    opened by RoarGronmo 15
  • [BUG] Json Schema Definition named

    [BUG] Json Schema Definition named "Query" generates invalid code

    Describe the bug If I add a definition to the swagger file with the name of query, the generated classes have a namespace collision with Chopper/annotations.dart's Query class.

    To Reproduce This swagger file reproduces the issue:

      "swagger": "2.0",
      "info": {
        "description": "This is a sample server Petstore server.  You can find out more about     Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).      For this sample, you can use the api key `special-key` to test the authorization     filters.",
        "version": "1.0.0",
        "title": "Swagger Petstore",
        "termsOfService": "http://swagger.io/terms/",
        "contact": {
          "email": "[email protected]"
        },
        "license": {
          "name": "Apache 2.0",
          "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
      },
      "host": "petstore.swagger.io",
      "basePath": "/v2",
      "schemes": [
        "https",
        "http"
      ],
      "paths": {
        "/pet/findByStatus": {
          "get": {
            "summary": "Finds Pets by status",
            "description": "Multiple status values can be provided with comma separated strings",
            "operationId": "findPetsByStatus",
            "produces": [
              "application/xml",
              "application/json"
            ],
            "parameters": [
              {
                "name": "status",
                "in": "query",
                "description": "Status values that need to be considered for filter",
                "required": true,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "available",
                    "pending",
                    "sold"
                  ],
                  "default": "available"
                },
                "collectionFormat": "multi"
              }
            ],
            "responses": {
              "200": {
                "description": "successful operation",
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/Pet"
                  }
                }
              },
              "400": {
                "description": "Invalid status value"
              }
            }
          }
        }
      },
      "definitions": {
        "Query": {
          "type": "object"
        },
        "Pet": {
          "type": "object"
        }
      }
    }
    

    Expected behavior I would expect the @chopper.Query annotation to be used instead of @Query. This will allow common words like Query, Path, Body, Header, etc. to be used in the API .

    Library version used: 2.3.13

    Additional context I'll start working on a PR for this.

    bug Triage needed 
    opened by vipw 14
  • [QUESTION] Chooper 4.x.x?

    [QUESTION] Chooper 4.x.x?

    Please describe a problem. I am wondering: Current published version is flaged as nullsafe but is using a non-nullsafe version of chopper (3.x) while there already is a published nullsafe version (4.x).

    Describe the solution you'd like Clarify whether 4.x is supported and if so update the readme.

    question 
    opened by masseelch 14
  • [FEATURE] copyWith extension methods that allow setting a field to null

    [FEATURE] copyWith extension methods that allow setting a field to null

    Is your feature request related to a problem? Please describe. I have an API that allows unsetting a value by POSTing a JSON document with a field set to NULL.

    For example a person's age can be unset with by POSTing a Person object to /person/personId

    {
      "name": "bob",
      "age": null
    } 
    

    The autogenerated Person class has

    extension $PersonExtension on Person {
      Person copyWith(
          {String? name,
          int? age) {
      return Person(
            name: name?? this.name,
            age: age?? this.age);
      }
    }
    

    This is usually very helpful but doesn't allow setting either field to null.

    This is a simplified example, I actually have dozens of entities, each with many members. Otherwise I would just do the obvious thing:

    newPerson = Person(name: oldPerson.name, age: null);
    

    Describe the solution you'd like I'm not sure it's the best solution, but I built my own extension method based on this post: https://stackoverflow.com/a/71732563/759140

    class Wrapped<T> {
      final T value;
      const Wrapped.value(this.value);
    }
    
    extension PersonExtensionWrapped on Person {
      Person copyWrapped(
          {Wrapped<String?>? name,
          Wrapped<int?>? age) {
      return Person(
            name: (name != null ? name.value : this.name),
            age: (age != null ? age.value : this.age)
          );
      }
    }
    
    

    It seems bloated to make copyWith and copyWrapped methods. Maybe it could be a configuration flag whether the copyWith uses wrapping or not.

    I also had a thought to add a copyButNullSomeFields method that would take bools, and null the specified fields:

    extension PersonExtensionNull on Person {
      Person copyButNullSomeFields(bool? name, bool? age) {
      return Person(
       name: (name == null || name == false) ? this.name : null;
       age: (age == null || age == false) ? this.name : null;
      }
    }
    

    But I haven't tried this one out yet. It might be a better for autogenerated code because it would be easy to chain it with copyWith().

    Swagger specification link N/A

    enhancement 
    opened by vipw 13
  • Cannot generate code from specific swagger 2.0 spec. Not sure why it's failing

    Cannot generate code from specific swagger 2.0 spec. Not sure why it's failing

    I am having an issue parsing this spec: https://webapidemo.rentalworks.net/swagger/accountservices-v1/swagger.json

    In fact, pretty much every spec from this site has issues with this generator. I am assuming there is something wrong with the spec itself but I'm having a hard time figuring out what since I'm not familiar with how these code generators currently work. It looks like it is incorrectly parsing. Any help would be appreciated. Thanks!

    Build runner output:

    [INFO] Generating build script completed, took 246ms
    [INFO] Reading cached asset graph completed, took 30ms
    [INFO] Checking for updates since last build completed, took 247ms
    [WARNING] swagger_dart_code_generator:swagger_dart_code_generator on lib/swagger/account_services.swagger:
    [WARNING] Code formatting failed.
              Please raise an issue on https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/
              Reason: Could not format because the source could not be parsed:
    
    line 1867, column 28 of .: Expected a class member.
         ╷
    1867 │     factory Func<Task<string>>.fromJson(Map<String, dynamic> json) => _$Func<Task<string>>FromJson(json);
         │                               ^
         ╵
    line 1449, column 20 of .: A function body must be provided.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                       ^
         ╵
    line 1449, column 32 of .: Expected a class member.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                                   ^^
         ╵
    line 1449, column 13 of .: A function body must be provided.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                ^
         ╵
    line 1449, column 29 of .: Expected a class member.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                                ^^
         ╵
    line 1867, column 14 of .: Constructors can't have type parameters.
         ╷
    1867 │     factory Func<Task<string>>.fromJson(Map<String, dynamic> json) => _$Func<Task<string>>FromJson(json);
         │                 ^^^^^^^^^^^^^^
         ╵
    line 1449, column 20 of .: Expected a class member.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                       ^
         ╵
    line 1449, column 36 of .: A function body must be provided.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                                       ^^^^^^^^^^^^
         ╵
    line 1867, column 28 of .: A function body must be provided.
         ╷
    1867 │     factory Func<Task<string>>.fromJson(Map<String, dynamic> json) => _$Func<Task<string>>FromJson(json);
         │                               ^
         ╵
    line 1449, column 32 of .: A function body must be provided.
         ╷
    1449 │     final Func%3CTask%3Cstring%3E%3E? jtiGenerator;
         │                                   ^^
         ╵
    (44 more errors...)
    [SEVERE] chopper_generator:chopper_generator on lib/generated_code/account_services.swagger.dart:
    
    This builder requires Dart inputs without syntax errors.
    However, package:rentalworks/generated_code/account_services.swagger.dart (or an existing part) contains the following errors.
    account_services.swagger.dart:1889:40: Unexpected text 'on'.
    account_services.swagger.dart:1449:31: Operator declarations must be preceded by the keyword 'operator'.
    account_services.swagger.dart:1449:14: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
    And 51 more...
    
    Try fixing the errors and re-running the build.
    
    [SEVERE] json_serializable:json_serializable on lib/generated_code/account_services.swagger.dart:
    
    This builder requires Dart inputs without syntax errors.
    However, package:rentalworks/generated_code/account_services.swagger.dart (or an existing part) contains the following errors.
    account_services.swagger.dart:1889:40: Unexpected text 'on'.
    account_services.swagger.dart:1449:31: Operator declarations must be preceded by the keyword 'operator'.
    account_services.swagger.dart:1449:14: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
    And 51 more...
    
    Try fixing the errors and re-running the build.
    
    [INFO] Running build completed, took 543ms
    [INFO] Caching finalized dependency graph completed, took 20ms
    [SEVERE] Failed after 569ms
    
    opened by point-source 13
  • [BUG]

    [BUG]

    Describe the bug Errors in generated code:

    1. [].enums.swagger.dart needs to be imported so [].swagger.g.dart use it Currently, it imported as import '[].enums.swagger.dart' as enums; which make [].swagger.g.dart throw errors
    2. For some reason code generated in [].swagger.dart, generates every $Response class and $ResponseExtension 3 times which also causes lots of errors
    3. Some classes are used in [].swagger.dart but missing
    4. Sometimes [].enums.swagger.dart would be just empty

    To Reproduce This would reproduce (3 + 4)

    {
    	"openapi": "3.0.3",
    	"paths": {
    		"/": {
    			"get": {
    				"responses": {
    					"200": {
    						"description": "Default Response",
    						"schema": {
    							"type": "object",
    							"properties": {
    								"hi": {
    									"type": "string",
    									"pattern": "gg"
    								}
    							},
    							"required": ["hi"],
    							"additionalProperties": false
    						}
    					}
    				}
    			}
    		},
    		"/health": {
    			"get": {
    				"responses": {
    					"200": {
    						"description": "Default Response",
    						"schema": {
    							"type": "object",
    							"properties": {
    								"message": {
    									"type": "string",
    									"pattern": "ok"
    								},
    								"uptime": {
    									"type": "number"
    								},
    								"date": {
    									"type": "string",
    									"format": "date-time"
    								}
    							},
    							"required": ["message", "uptime", "date"],
    							"additionalProperties": false
    						}
    					}
    				}
    			}
    		},
    		"/tasks": {
    			"get": {
    				"responses": {
    					"200": {
    						"description": "Default Response",
    						"schema": {
    							"type": "object",
    							"properties": {
    								"data": {
    									"type": "object",
    									"properties": {
    										"tasks": {
    											"type": "array",
    											"items": {
    												"type": "object",
    												"properties": {
    													"task_id": {
    														"type": "string",
    														"format": "uuid"
    													},
    													"title": {
    														"type": "string",
    														"default": "Some task"
    													},
    													"description": {
    														"type": "string",
    														"nullable": true,
    														"default": null
    													},
    													"is_done": {
    														"type": "boolean",
    														"default": false
    													},
    													"priority": {
    														"type": "number",
    														"default": 1
    													},
    													"reminders": {
    														"type": "array",
    														"items": {
    															"type": "number"
    														},
    														"nullable": true,
    														"default": []
    													},
    													"owner_id": {
    														"type": "string",
    														"format": "uuid"
    													},
    													"category_id": {
    														"type": "string",
    														"format": "uuid",
    														"nullable": true
    													},
    													"course_id": {
    														"type": "string",
    														"format": "uuid",
    														"nullable": true
    													},
    													"class_id": {
    														"type": "string",
    														"format": "uuid",
    														"nullable": true
    													},
    													"country_id": {
    														"type": "string",
    														"format": "uuid",
    														"nullable": true
    													},
    													"ignore_time": {
    														"type": "boolean",
    														"default": false
    													},
    													"start_date": {
    														"allOf": [
    															{
    																"type": "string",
    																"format": "date-time",
    																"nullable": true,
    																"default": null
    															},
    															{
    																"type": "string",
    																"format": "date-time",
    																"nullable": true,
    																"default": null
    															}
    														]
    													},
    													"end_date": {
    														"allOf": [
    															{
    																"type": "string",
    																"format": "date-time",
    																"nullable": true,
    																"default": null
    															},
    															{
    																"type": "string",
    																"format": "date-time",
    																"nullable": true,
    																"default": null
    															}
    														]
    													},
    													"created_at": {
    														"allOf": [
    															{
    																"type": "string",
    																"format": "date-time",
    																"default": "2022-12-31T23:09:01.468Z"
    															},
    															{
    																"type": "string",
    																"format": "date-time",
    																"default": "2022-12-31T23:09:01.468Z"
    															}
    														]
    													},
    													"updated_at": {
    														"allOf": [
    															{
    																"type": "string",
    																"format": "date-time",
    																"default": "2022-12-31T23:09:01.468Z"
    															},
    															{
    																"type": "string",
    																"format": "date-time",
    																"default": "2022-12-31T23:09:01.468Z"
    															}
    														]
    													},
    													"subtasks": {
    														"type": "array",
    														"items": {
    															"type": "object",
    															"properties": {
    																"subtask_id": {
    																	"type": "string",
    																	"format": "uuid"
    																},
    																"title": {
    																	"type": "string",
    																	"default": "Something"
    																},
    																"is_done": {
    																	"type": "boolean",
    																	"default": false
    																},
    																"task_id": {
    																	"type": "string",
    																	"format": "uuid"
    																},
    																"order": {
    																	"type": "integer",
    																	"default": 0
    																}
    															},
    															"required": ["subtask_id", "task_id"],
    															"additionalProperties": false
    														},
    														"default": []
    													}
    												},
    												"required": ["task_id", "owner_id"],
    												"additionalProperties": false
    											}
    										},
    										"categories": {
    											"type": "array",
    											"items": {
    												"type": "object",
    												"properties": {
    													"category_id": {
    														"type": "string",
    														"format": "uuid"
    													},
    													"name": {
    														"type": "string",
    														"default": "A category"
    													},
    													"owner_id": {
    														"type": "string",
    														"format": "uuid"
    													}
    												},
    												"required": ["category_id", "owner_id"],
    												"additionalProperties": false
    											}
    										},
    										"groups": {
    											"type": "array",
    											"items": {
    												"type": "object",
    												"properties": {
    													"group_id": {
    														"type": "string",
    														"format": "uuid"
    													},
    													"name": {
    														"type": "string",
    														"default": "My list"
    													},
    													"emoji": {
    														"type": "string",
    														"default": ""
    													},
    													"view": {
    														"type": "string",
    														"enum": ["list", "calendar", "mix", "board"],
    														"default": "list"
    													},
    													"group_by": {
    														"type": "string",
    														"enum": ["none", "class_", "priority", "week", "category"],
    														"default": "none"
    													},
    													"filter": {
    														"default": null
    													},
    													"sort": {
    														"default": null
    													},
    													"wallpaper_url": {
    														"type": "string",
    														"nullable": true,
    														"default": null
    													},
    													"owner_id": {
    														"type": "string",
    														"format": "uuid"
    													}
    												},
    												"required": ["group_id", "owner_id"],
    												"additionalProperties": false
    											}
    										}
    									},
    									"required": ["tasks", "categories", "groups"],
    									"additionalProperties": false
    								}
    							},
    							"required": ["data"],
    							"additionalProperties": false
    						}
    					}
    				}
    			}
    		}
    	}
    }
    

    Expected behavior

    1. Import [].enums.swagger.dart in [].swagger.dart ([].swagger.g.dart uses it)
    2. Generated code in [].swagger.dart should not have duplicated classes or extensions

    Library version used: 2.9.0

    bug Triage needed 
    opened by ihadabs 0
  • [BUG] generated response body is always `dynamic` when status code is `202`

    [BUG] generated response body is always `dynamic` when status code is `202`

    Describe the bug

    When the response status code is 202, the response body type is not generated properly.

    For example, change "200" to "202" in pet_service_json.json:

    "/pet/{petId}": {
      "get": {
        "tags": [
          "pet"
        ],
        "summary": "Find pet by ID",
        "description": "Returns a single pet",
        "operationId": "getPetById",
        "produces": [
          "application/xml",
          "application/json"
        ],
        "parameters": [
          {
            "name": "petId",
            "in": "path",
            "description": "ID of pet to return",
            "required": true,
            "type": "integer",
            "format": "int64"
          }
        ],
        "responses": {
          "202": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/Pet"
            }
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Pet not found"
          }
        },
      },
    

    The generated code looks like this:

    Future<chopper.Response> petPetIdGet //...
    

    But it should look like this:

    Future<chopper.Response<Pet>> petPetIdGet //...
    

    The type is lost when the status is 202.

    I have a swagger JSON file full of such 202 responses, and currently the only workaround is to manually replace them with 200.

    Library versions used: Latest example project

    bug Triage needed 
    opened by dJani97 1
  • [BUG] Generation fails if input_folder setting doesn't end with a

    [BUG] Generation fails if input_folder setting doesn't end with a "/"

    Describe the bug

    I was getting the following error when running my build on Windows 11:

    [SEVERE] swagger_dart_code_generator on lib/swaggersopenapi.yaml:
    
    type 'Null' is not a subtype of type 'YamlMap' in type cast
    

    My input folder was specified as "lib/swaggers" and my "input_urls" includes a file names openapi.yaml that gets downloaded during the build.

    Changing the input_folder to "lib/swaggers/" fixed the issue for me, however this seems like it should not actually be needed.

    To Reproduce

    1. Install swagger-dart-code-generator in a Flutter project (in Windows 11, but I'm not sure if that matters)
    2. Specify input_folder in build.yaml as "lib/swaggers"
    3. Make sure the lib/swaggers folder exists
    4. Specify a swagger file in the "input_urls" option (I'm not sure if this is required for the issue to occur or if it will also happen with a local-only file)
    5. Run build_runner and get error mentioned above.

    Expected behavior

    The input_folder option should work identically whether it ends in a slash or not.

    Library version used: 2.9.0

    bug Triage needed 
    opened by bmcclure 0
  • Single entry allOf ref type is possible to

    Single entry allOf ref type is possible to "guess" referenced model type

    Is your feature request related to a problem? Please describe. When $ref property is nested into allOf schema array, type is evaluated as dynamic even it is the only one ref entry.

              "address": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Address"
                  },
                  {
                    "title": "Address",
                    "description": "Address usable to send some documents via post",
                    "nullable": true
                  }
                ]
              },
    

    To Reproduce Please attach swagger and code snippet of generated value

    Schema:

    {
      "paths": {
        "/v1/churches": {
          "post": {
            "tags": [
              "Church Controller"
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/AddChurchRequestBody"
                  }
                }
              }
            },
            "responses": {
              "200": {
                "description": "OK",
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/Unit"
                    }
                  }
                }
              },
              "401": {
                "description": "Not Authorized"
              },
              "403": {
                "description": "Not Allowed"
              }
            }
          }
        }
      },
      "components": {
        "schemas": {
          "AddChurchRequestBody": {
            "description": "Include all required fields to add new church to system",
            "required": [
              "cin",
              "name",
              "address",
              "email",
              "phoneNumber",
              "website"
            ],
            "type": "object",
            "properties": {
              "cin": {
                "pattern": "^((AT)?U[0-9]{8}|(BE)?0[0-9]{9}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}L|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}L|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})$",
                "type": "string",
                "nullable": true
              },
              "name": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              },
              "address": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Address"
                  },
                  {
                    "nullable": true
                  }
                ]
              },
              "email": {
                "pattern": "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])",
                "type": "string",
                "nullable": true
              },
              "phoneNumber": {
                "pattern": "^\\+\\d{10,12}$",
                "type": "string",
                "nullable": true
              },
              "website": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              }
            }
          },
          "Address": {
            "description": "Value object used to localize person or church via post or GPS",
            "required": [
              "geolocation",
              "country",
              "street",
              "streetNumber",
              "city",
              "postalCode"
            ],
            "type": "object",
            "properties": {
              "geolocation": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Geolocation"
                  },
                  {
                    "nullable": true
                  }
                ]
              },
              "country": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              },
              "street": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              },
              "streetNumber": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              },
              "city": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              },
              "postalCode": {
                "pattern": "\\S",
                "type": "string",
                "nullable": true
              }
            }
          },
          "Geolocation": {
            "description": "GPS coordination",
            "required": [
              "latitude",
              "longitude"
            ],
            "type": "object",
            "properties": {
              "latitude": {
                "format": "double",
                "maximum": 180,
                "minimum": -180,
                "type": "number",
                "nullable": true
              },
              "longitude": {
                "format": "double",
                "maximum": 90,
                "minimum": -90,
                "type": "number",
                "nullable": true
              }
            }
          }
        }
      }
    }
    

    Generated model:

    @JsonSerializable(explicitToJson: true)
    class AddChurchRequestBody {
      AddChurchRequestBody({
        required this.cin,
        required this.name,
        required this.address,
        required this.email,
        required this.phoneNumber,
        required this.website,
      });
    
      factory AddChurchRequestBody.fromJson(Map<String, dynamic> json) =>
          _$AddChurchRequestBodyFromJson(json);
    
      @JsonKey(name: 'cin')
      final String? cin;
      @JsonKey(name: 'name')
      final String? name;
      @JsonKey(name: 'address')
      final dynamic address;
      @JsonKey(name: 'email')
      final String? email;
      @JsonKey(name: 'phoneNumber')
      final String? phoneNumber;
      @JsonKey(name: 'website')
      final String? website;
      static const fromJsonFactory = _$AddChurchRequestBodyFromJson;
      static const toJsonFactory = _$AddChurchRequestBodyToJson;
      Map<String, dynamic> toJson() => _$AddChurchRequestBodyToJson(this);
    
      @override
      bool operator ==(dynamic other) {
        return identical(this, other) ||
            (other is AddChurchRequestBody &&
                (identical(other.cin, cin) ||
                    const DeepCollectionEquality().equals(other.cin, cin)) &&
                (identical(other.name, name) ||
                    const DeepCollectionEquality().equals(other.name, name)) &&
                (identical(other.address, address) ||
                    const DeepCollectionEquality()
                        .equals(other.address, address)) &&
                (identical(other.email, email) ||
                    const DeepCollectionEquality().equals(other.email, email)) &&
                (identical(other.phoneNumber, phoneNumber) ||
                    const DeepCollectionEquality()
                        .equals(other.phoneNumber, phoneNumber)) &&
                (identical(other.website, website) ||
                    const DeepCollectionEquality().equals(other.website, website)));
      }
    
      @override
      String toString() => jsonEncode(this);
    
      @override
      int get hashCode =>
          const DeepCollectionEquality().hash(cin) ^
          const DeepCollectionEquality().hash(name) ^
          const DeepCollectionEquality().hash(address) ^
          const DeepCollectionEquality().hash(email) ^
          const DeepCollectionEquality().hash(phoneNumber) ^
          const DeepCollectionEquality().hash(website) ^
          runtimeType.hashCode;
    }
    
    @JsonSerializable(explicitToJson: true)
    class Address {
      Address({
        required this.geolocation,
        required this.country,
        required this.street,
        required this.streetNumber,
        required this.city,
        required this.postalCode,
      });
    
      factory Address.fromJson(Map<String, dynamic> json) =>
          _$AddressFromJson(json);
    
      @JsonKey(name: 'geolocation')
      final dynamic geolocation;
      @JsonKey(name: 'country')
      final String? country;
      @JsonKey(name: 'street')
      final String? street;
      @JsonKey(name: 'streetNumber')
      final String? streetNumber;
      @JsonKey(name: 'city')
      final String? city;
      @JsonKey(name: 'postalCode')
      final String? postalCode;
      static const fromJsonFactory = _$AddressFromJson;
      static const toJsonFactory = _$AddressToJson;
      Map<String, dynamic> toJson() => _$AddressToJson(this);
    
      @override
      bool operator ==(dynamic other) {
        return identical(this, other) ||
            (other is Address &&
                (identical(other.geolocation, geolocation) ||
                    const DeepCollectionEquality()
                        .equals(other.geolocation, geolocation)) &&
                (identical(other.country, country) ||
                    const DeepCollectionEquality()
                        .equals(other.country, country)) &&
                (identical(other.street, street) ||
                    const DeepCollectionEquality().equals(other.street, street)) &&
                (identical(other.streetNumber, streetNumber) ||
                    const DeepCollectionEquality()
                        .equals(other.streetNumber, streetNumber)) &&
                (identical(other.city, city) ||
                    const DeepCollectionEquality().equals(other.city, city)) &&
                (identical(other.postalCode, postalCode) ||
                    const DeepCollectionEquality()
                        .equals(other.postalCode, postalCode)));
      }
    
      @override
      String toString() => jsonEncode(this);
    
      @override
      int get hashCode =>
          const DeepCollectionEquality().hash(geolocation) ^
          const DeepCollectionEquality().hash(country) ^
          const DeepCollectionEquality().hash(street) ^
          const DeepCollectionEquality().hash(streetNumber) ^
          const DeepCollectionEquality().hash(city) ^
          const DeepCollectionEquality().hash(postalCode) ^
          runtimeType.hashCode;
    }
    
    @JsonSerializable(explicitToJson: true)
    class Geolocation {
      Geolocation({
        required this.latitude,
        required this.longitude,
      });
    
      factory Geolocation.fromJson(Map<String, dynamic> json) =>
          _$GeolocationFromJson(json);
    
      @JsonKey(name: 'latitude')
      final double? latitude;
      @JsonKey(name: 'longitude')
      final double? longitude;
      static const fromJsonFactory = _$GeolocationFromJson;
      static const toJsonFactory = _$GeolocationToJson;
      Map<String, dynamic> toJson() => _$GeolocationToJson(this);
    
      @override
      bool operator ==(dynamic other) {
        return identical(this, other) ||
            (other is Geolocation &&
                (identical(other.latitude, latitude) ||
                    const DeepCollectionEquality()
                        .equals(other.latitude, latitude)) &&
                (identical(other.longitude, longitude) ||
                    const DeepCollectionEquality()
                        .equals(other.longitude, longitude)));
      }
    
      @override
      String toString() => jsonEncode(this);
    
      @override
      int get hashCode =>
          const DeepCollectionEquality().hash(latitude) ^
          const DeepCollectionEquality().hash(longitude) ^
          runtimeType.hashCode;
    }
    

    Describe the solution you'd like Nested schema objects in oneOf, anyOf, allOf, not arrays should be handled properly at least for a simple single-entry use case.

    Library version used: 2.9.0

    Swagger specification link oneOf, anyOf, allOf, not

    enhancement 
    opened by Krawart 0
  • [BUG] Issue while generating multipart/form-data, recurring classes

    [BUG] Issue while generating multipart/form-data, recurring classes

    Describe the bug

    When generating a request I noticed an error. As soon as I specify the Content-Type multipart/form-data, the wrong type is used for the parameters. The class of the parameter is defined as type. In the example below you can see the result.

    To Reproduce

    swagger.yaml

    openapi: 3.0.3
    info:
      title: Swagger Petstore - OpenAPI 3.0
      description: Test
      termsOfService: http://swagger.io/terms/
      contact:
        email: [email protected]
      license:
        name: Apache 2.0
        url: http://www.apache.org/licenses/LICENSE-2.0.html
      version: 1.0.11
    externalDocs:
      description: Find out more about Swagger
      url: http://swagger.io
    servers:
      - url: https://petstore3.swagger.io/api/v3
    paths:
      /api/devices/:
        post:
          operationId: devices_post
          description: >-
            Creates a device, representative of a physical sensor or actor connected to
            IoT via a gateway.
          summary: Create Device
          tags:
            - device
          requestBody:
            content:
              multipart/form-data:
                schema:
                  $ref: "#/components/schemas/DeviceRequest"
            required: true
          responses:
            "201":
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/Device"
              description: ""
    components:
      schemas:
        Device:
          type: object
          properties:
            name:
              type: string
        DeviceRequest:
          type: object
          properties:
            file:
              type: string
              format: binary
              writeOnly: true
            file_name:
              type: string
              minLength: 1
            file_created_by:
              type: integer
            conf:
              type: integer
            unit_id:
              type: integer
          required:
            - conf
            - unit_id
    

    build.yaml

    targets:
      $default:
        sources:
          - lib/**
          - swaggers/**
          - swaggers2/**
          - input_folder/**
          - swagger_examples/**
          - $package$
          - pubspec.yaml
        builders:
          chopper_generator:
            options:
              header: "//Generated code"
          swagger_dart_code_generator:
            options:
              input_folder: "input_folder/"
              output_folder: "lib/swagger_generated_code/"
              build_only_models: false
              enums_case_sensitive: true
              separate_models: false
    
    

    Result

      Future<chopper.Response<Device>> apiDevicesPost({
        List<int>? file,
        DeviceRequest? fileName,
        DeviceRequest? fileCreatedBy,
        required DeviceRequest? conf,
        required DeviceRequest? unitId,
      }) {
    

    Expected behavior

      Future<chopper.Response<Device>> apiDevicesPost({
        List<int>? file,
        String? fileName,
        String? fileCreatedBy,
        required int? conf,
        required int? unitId,
      }) {
    

    Library version used:

    2.8.5

    bug Triage needed 
    opened by mfrischbutter 2
Owner
null
OpenAPI generator for Dart & Flutter

Fantom Fantom is a cli tool for generating API layer based on OpenAPI Spec. Usage Install fantom $ dart pub global activate fantom Generate API client

REKAB 13 Oct 18, 2022
VS Code `.code-workspace` file generator

VS Code .code-workspace file generator (for monorepositories with Dart and Flutter projects) TL;DR; Create yaml file config.yaml (check #Format sectio

Mike T 1 Feb 18, 2022
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. Inspired by SwiftGen. Motivation Using asset path str

FlutterGen 1.1k Jan 6, 2023
Starter project and code generator for Flutter/Redux

Flutter Redux Starter/Code Generator Videos Short video ~ 1 minute Long video ~ 10 minutes We're using this approach to develop the Flutter app for In

Hillel Coren 278 Dec 12, 2022
🚀The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time.

Flutter Gen Zeplin Extension ?? The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time. ⬇ 1.1k Getti

NAVER 49 Oct 12, 2022
Dart Code Generator for generating mapper classes

Smartstruct - Dart bean mappings - the easy nullsafe way! Code generator for generating type-safe mappers in dart, inspired by https://mapstruct.org/

Nils 28 Nov 29, 2022
The Dart code generator for your package versions. 🎯

The Dart code generator for your package versions. There is no way to get the package version from the code in the Dart ecosystem. Installation Add bu

Daichi Furiya 12 Dec 14, 2022
Environment specific config generator for Dart and Flutter applications during CI/CD builds

Environment Config Generator Environment specific config generator. Allows to specify env configuration during CI/CD build. Primarily created to simpl

Denis Beketsky 86 Dec 2, 2022
A Flutter curl-command generator for Dio

curl_logger_dio_interceptor A Flutter curl-command generator for Dio. Easily test your Flutter-made requests in your favorite terminal or even in Post

null 7 Nov 17, 2022
Flutter Word generator

wordpair_generator A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Aristide Sabi 0 Dec 3, 2021
Random color generator for Flutter

Random color generator Pub link: https://pub.dartlang.org/packages/random_color This library will generate random colors that are visually pleasing an

Luka Knezic 56 Jun 13, 2022
A Flutter Word generator App to improve English vocabulary

Word generator App to improve English vocabulary: Add English words you don't know and their translation, then you need to answer what is the translat

Gustavo Bonassa 1 Dec 12, 2021
A certificate generator app developed in Flutter with love.

Holden Certificate Generator made with Flutter. Dependencies spreadsheet_decoder path_provider file_picker pdf_viewer_plugin pdf permission_handler sh

null 20 Jan 4, 2023
Destiny is a new, mock-data generator for Dart/Flutter

Destiny is a new, mock-data generator for Dart/Flutter. It uses static methods couched in a destiny namespace as the API.

Aditya Kishore 11 Sep 16, 2022
Flutter Google Sheet localizations generator

Flutter Google Sheet localizations generator Generates a localizations delegate from an online Google Sheet file. Install Add the following to your pu

Aloïs Deniel 277 Dec 19, 2022
GPT-3 recipe generator for the GPT-3 Makeathon by TUM.AI. Developed by team Taste the data.

GPT-3 Makeathon by TUM.AI - Team: Taste the Data Team - Taste the Data: Carmen Heger <@stedomedo> David Stiftl <@stiftlD> Christopher Schütz <@cdschtz

Oliver Klukas 11 Dec 4, 2022
A generator to create config class from json files that support many environments

A generator to create config class from json files that support many environments. Motivation If you use a json file to config your applications, perp

Diego Cardenas 0 Oct 9, 2021
Provide route generator to create route map quickly by annotations.

ff_annotation_route Languages: English | 中文简体 Description Provide a route generator to create route map quickly by annotations. ff_annotation_route De

FlutterCandies 113 Nov 25, 2022