OpenAPIInfo.fromJson constructor
Wraps decoded JSON.
Implementation
factory OpenAPIInfo.fromJson(Map<String, Object?> json) => OpenAPIInfo._({
'title': requireString(json, 'title', scope: 'openapi'),
'version': requireString(json, 'version', scope: 'openapi'),
'summary': ?optionalString(json, 'summary', scope: 'openapi'),
'description': ?optionalString(json, 'description', scope: 'openapi'),
'termsOfService': ?optionalString(json, 'termsOfService', scope: 'openapi'),
'contact': ?switch (optionalMap(json['contact'], scope: 'openapi')) {
final value? => OpenAPIContact.fromJson(value),
null => null,
},
'license': ?switch (optionalMap(json['license'], scope: 'openapi')) {
final value? => OpenAPILicense.fromJson(value),
null => null,
},
...extractExtensions(json),
});