encode method Null safety

  1. @override
void encode(
  1. KeyedArchive object
)
override

Implementation

@override
void encode(KeyedArchive object) {
  super.encode(object);

  if (responses == null) {
    throw ArgumentError(
      "Invalid specification. APIOperation must have non-null values for: 'responses'.",
    );
  }

  object.encode("tags", tags);
  object.encode("summary", summary);
  object.encode("description", description);
  object.encode("operationId", id);
  object.encodeObjects("parameters", parameters);
  object.encodeObject("requestBody", requestBody);
  object.encodeObjectMap("responses", responses);
  object.encodeObjectMap("callbacks", callbacks);
  object.encode("deprecated", deprecated);
  object.encodeObjects("security", security);
  object.encodeObjects("servers", servers);
}