encode method

void encode(
  1. KeyedArchive json
)

Implementation

void encode(KeyedArchive json) {
  json.encode("name", name);
  json.encode("description", description);
  json.encode("in", APIParameterLocationCodec.encode(location!));
  json.encode("required", required);

  if (location == APIParameterLocation.body) {
    json.encodeObject("schema", schema);
  } else {
    super.encode(json);
    json.encode("allowEmptyValue", allowEmptyValue);
    if (type == APIType.array) {
      json.encodeObject("items", items);
    }
  }
}