def get_link(
        self, base_url, path, path_info, operation, operation_info, schema_definitions
    ):
        """
        Return a single link in the document.
        """
        name = operation_info.get("operationId")
        title = operation_info.get("summary")
        description = operation_info.get("description")

        if name is None:
            name = _simple_slugify(title)
            if not name:
                return None

        # Parameters are taken both from the path info, and from the operation.
        parameters = path_info.get("parameters", [])
        parameters += operation_info.get("parameters", [])

        fields = [
            self.get_field(parameter, schema_definitions) for parameter in parameters
        ]

        default_encoding = None
        if any([field.location == "body" for field in fields]):
            default_encoding = "application/json"
        elif any([field.location == "formData" for field in fields]):
            default_encoding = "application/x-www-form-urlencoded"
            form_fields = [field for field in fields if field.location == "formData"]
            body_field = Field(
                name="body",
                location="body",
                schema=typesystem.Object(
                    properties={
                        field.name: typesystem.Any()
                        if field.schema is None
                        else field.schema
                        for field in form_fields
                    },
                    required=[field.name for field in form_fields if field.required],
                ),
            )
            fields = [field for field in fields if field.location != "formData"]
            fields.append(body_field)

        encoding = lookup(operation_info, ["consumes", 0], default_encoding)

        return Link(
            name=name,
            url=urljoin(base_url, path),
            method=operation,
            title=title,
            description=description,
            fields=fields,
            encoding=encoding,
        )

        Return a single link in the document.
        
apistar/schemas/swagger.py