# Code generation configuration for OpenAPI client
# This file configures how Dart code is generated from the OpenAPI specification

targets:
  $default:
    builders:
      # OpenAPI code generator - generates client code from openapi.json
      openapi_generator:
        enabled: true
        generate_for:
          - lib/api/openapi_config.dart
        options:
          # Path to OpenAPI spec (generated by backend)
          inputSpec: api-schema.json

          # Generator configuration
          generatorName: dart-dio

          # Output directory for generated code
          output: lib/api/generated

          # Additional configuration
          additionalProperties:
            pubName: console
            useEnumExtension: true
            enumUnknownDefaultCase: true
            nullableFields: true

          # Skip validation (backend controls the spec)
          skipValidateSpec: false

          # Verbose logging for debugging
          verbose: false

      # JSON serialization builder
      json_serializable:
        enabled: true
        generate_for:
          - lib/**/*.dart
        options:
          # Strict null safety
          explicit_to_json: true
          any_map: false
          checked: true
          create_to_json: true
          disallow_unrecognized_keys: false
          field_rename: none
