swagger_parser
swagger_parser copied to clipboard
dio import name clash
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, unused_import
import 'package:dio/dio.dart';
import 'package:retrofit/retrofit.dart';
import '../models/options.dart';
part 'client_client.g.dart';
@RestApi()
abstract class ClientClient {
factory ClientClient(Dio dio, {String? baseUrl}) = _ClientClient;
@GET('/test')
Future<String> test({
@Query('options') Options? options, // <<< Dio has an Option, we need to use prefixes
});
}
Schema
openapi: 3.0.3
info:
title: deepobject-array-with-pattern-test
version: 1.0.0
paths:
/test:
get:
operationId: test
parameters:
- name: options
in: query
required: false
style: deepObject
schema:
$ref: '#/components/schemas/Options'
explode: true
responses:
'200':
description: OK
content:
text/plain:
schema:
type: string
components:
schemas:
Options:
type: object
properties:
a:
type: array
items:
type: string
pattern: '^[A-Z].*'
Proposal we add a suffix Model to each Dto.
We can make it customizable via config
E.G Instead of Person it will be PersonModel
This suffix will be customizable via config
It would be a breaking change
@Carapacik How to you want to handle this?