    def from_data(*, data: oai.Operation, path: str, method: str, tag: str) -> Union[Endpoint, ParseError]:
        """ Construct an endpoint from the OpenAPI data """

        if data.operationId is None:
            return ParseError(data=data, detail="Path operations with operationId are not yet supported")

        endpoint = Endpoint(
            path=path,
            method=method,
            description=data.description,
            name=data.operationId,
            requires_security=bool(data.security),
            tag=tag,
        )

        result = Endpoint._add_parameters(endpoint, data)
        if isinstance(result, ParseError):
            return result
        result = Endpoint._add_responses(result, data.responses)
        if isinstance(result, ParseError):
            return result
        result = Endpoint._add_body(result, data)

        return result
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.