BearerSecurityScheme.fromJson constructor

BearerSecurityScheme.fromJson(
  1. Map<String, dynamic> json,
  2. PrefixMapping prefixMapping,
  3. Set<String> parsedFields
)

Creates a BearerSecurityScheme from a json object.

Implementation

factory BearerSecurityScheme.fromJson(
  Map<String, dynamic> json,
  PrefixMapping prefixMapping,
  Set<String> parsedFields,
) {
  final description = json.parseField<String>("description", parsedFields);
  final descriptions =
      json.parseMapField<String>("descriptions", parsedFields);
  final jsonLdType = json.parseArrayField<String>("@type");
  final proxy = json.parseUriField("proxy", parsedFields);

  final name = json.parseField<String>("name", parsedFields);
  final in_ = json.parseField<String>("in", parsedFields) ?? _defaultInValue;
  final format =
      json.parseField<String>("format", parsedFields) ?? _defaultFormatValue;
  final alg =
      json.parseField<String>("alg", parsedFields) ?? _defaultAlgValue;
  final authorization =
      json.parseField<String>("authorization", parsedFields);

  final additionalFields =
      json.parseAdditionalFields(prefixMapping, parsedFields);

  return BearerSecurityScheme(
    description: description,
    descriptions: descriptions,
    jsonLdType: jsonLdType,
    proxy: proxy,
    name: name,
    in_: in_,
    format: format,
    alg: alg,
    authorization: authorization,
    additionalFields: additionalFields,
  );
}