langchain_community.tools.openapi.utils.api_models.APIProperty¶

class langchain_community.tools.openapi.utils.api_models.APIProperty[source]¶

Bases: APIPropertyBase

A model for a property in the query, path, header, or cookie params.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param default: Optional[Any] = None¶

The default value of the property.

param description: Optional[str] = None¶

The description of the property.

param location: APIPropertyLocation [Required]¶

The path/how it’s being passed to the endpoint.

param name: str [Required]¶

The name of the property.

param required: bool [Required]¶

Whether the property is required.

param type: Union[str, Type, tuple, None, Enum] = None¶

The type of the property.

Either a primitive type, a component/parameter type, or an array or ‘object’ (dict) of the above.

classmethod from_parameter(parameter: Parameter, spec: OpenAPISpec) APIProperty[source]¶

Instantiate from an OpenAPI Parameter.

Parameters
Return type

APIProperty

static is_supported_location(location: str) bool[source]¶

Return whether the provided location is supported.

Parameters

location (str) –

Return type

bool