Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllOf duplication filds #204

Open
dickermoshe opened this issue Mar 4, 2024 · 0 comments
Open

AllOf duplication filds #204

dickermoshe opened this issue Mar 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dickermoshe
Copy link
Contributor

Generated

// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, unused_import, invalid_annotation_target

import 'package:freezed_annotation/freezed_annotation.dart';

part 'model_c.freezed.dart';
part 'model_c.g.dart';

@Freezed()
class ModelC with _$ModelC {
  const factory ModelC({
    required String foo,
    @JsonKey(name: 'duplicated_optional')
    required String duplicatedOptional0,
    @JsonKey(name: 'duplicated_optional')
    required int duplicatedOptional1,
    @JsonKey(name: 'duplicated_required')
    required String duplicatedRequired0,
    @JsonKey(name: 'duplicated_required')
    required int duplicatedRequired1,
    required String bar,
    required String baz,
  }) = _ModelC;
  
  factory ModelC.fromJson(Map<String, Object?> json) => _$ModelCFromJson(json);
}

Schema

openapi: 3.0.0
info:
  title: TestApi
  version: 1.0.0
paths:
  /test:
    get:
      summary: Test
      operationId: testApi
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelC"
components:
  schemas:
    ModelA:
      required:
        - duplicated_required
      properties:
        foo:
          type: string
        duplicated_optional:
           type: string
        duplicated_required:
           type: string
    ModelB:
      required:
        - duplicated_required
      properties:
        bar:
          type: string
        duplicated_optional:
           type: integer
        duplicated_required:
           type: integer
    ModelC:
      allOf:
        - $ref: "#/components/schemas/ModelA"
        - $ref: "#/components/schemas/ModelB"
        - type: object
          properties:
            baz:
              type: string


@Carapacik Carapacik added the bug Something isn't working label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants