// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, unused_import
import 'package:freezed_annotation/freezed_annotation.dart';
import 'owner.dart';
part 'club.freezed.dart';
part 'club.g.dart';
@Freezed()
class Club with _$Club {
const factory Club({
owner? owner, // Should be Owner
}) = _Club;
factory Club.fromJson(Map<String, Object?> json) => _$ClubFromJson(json);
}
owner.dart
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, unused_import
import 'package:freezed_annotation/freezed_annotation.dart';
part 'owner.freezed.dart';
part 'owner.g.dart';
@Freezed()
class Owner with _$Owner {
const factory Owner({
String? name,
}) = _Owner;
factory Owner.fromJson(Map<String, Object?> json) => _$OwnerFromJson(json);
}
Schema
openapi: 3.0.1
info:
version: 1.0.0
title: Example
license:
name: MIT
servers:
- url: http://api.example.xyz/v1
paths:
/person/display/{personId}:
get:
parameters:
- name: personId
in: path
required: true
description: The id of the person to retrieve
schema:
type: string
operationId: list
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/club"
components:
schemas:
club:
properties:
owner:
allOf:
- $ref: '#/components/schemas/owner'
nullable: true
owner:
properties:
name:
type: string
maxLength: 255
club.dart
owner.dart
Schema