PskSecurityScheme.fromJson constructor

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

Creates a PskSecurityScheme from a json object.

Implementation

factory PskSecurityScheme.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 identity = json.parseField<String>("identity");

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

  return PskSecurityScheme(
    description: description,
    descriptions: descriptions,
    jsonLdType: jsonLdType,
    proxy: proxy,
    identity: identity,
    additionalFields: additionalFields,
  );
}