diff --git a/sdk/core/azure-core/azure/core/exceptions.py b/sdk/core/azure-core/azure/core/exceptions.py index b87ee2a85869..51f5bb5d5c0f 100644 --- a/sdk/core/azure-core/azure/core/exceptions.py +++ b/sdk/core/azure-core/azure/core/exceptions.py @@ -172,25 +172,29 @@ class ODataV4Format: Example of JSON: - error: { - "code": "ValidationError", - "message": "One or more fields contain incorrect values: ", - "details": [ - { - "code": "ValidationError", - "target": "representation", - "message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'. - Path 'host', line 1, position 297." - }, - { + .. code-block:: json + + { + "error": { "code": "ValidationError", - "target": "representation", - "message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate - https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md - (schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)." + "message": "One or more fields contain incorrect values: ", + "details": [ + { + "code": "ValidationError", + "target": "representation", + "message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\\\d+)?$'. + Path 'host', line 1, position 297." + }, + { + "code": "ValidationError", + "target": "representation", + "message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate + https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md + (schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)." + } + ] } - ] - } + } :param dict json_object: A Python dict representing a ODataV4 JSON :ivar str ~.code: Its value is a service-defined error code. diff --git a/sdk/core/azure-core/azure/core/messaging.py b/sdk/core/azure-core/azure/core/messaging.py index 1efd544c2b5f..bd4e71867a40 100644 --- a/sdk/core/azure-core/azure/core/messaging.py +++ b/sdk/core/azure-core/azure/core/messaging.py @@ -216,8 +216,8 @@ def from_dict(cls, event: Dict[str, Any]) -> CloudEvent[DataType]: @classmethod def from_json(cls, event: Any) -> CloudEvent[DataType]: - """ - Returns the deserialized CloudEvent object when a json payload is provided. + """Returns the deserialized CloudEvent object when a json payload is provided. + :param event: The json string that should be converted into a CloudEvent. This can also be a storage QueueMessage, eventhub's EventData or ServiceBusMessage :type event: object diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/_base.py b/sdk/core/azure-core/azure/core/pipeline/policies/_base.py index dc01fb44a8ee..fce407a081df 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/_base.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/_base.py @@ -110,14 +110,6 @@ def on_exception( :param request: The Pipeline request object :type request: ~azure.core.pipeline.PipelineRequest - - .. admonition:: Example: - - .. literalinclude:: ../samples/test_example_sansio.py - :start-after: [START on_exception] - :end-before: [END on_exception] - :language: python - :dedent: 4 """ return diff --git a/sdk/core/azure-core/azure/core/tracing/_abstract_span.py b/sdk/core/azure-core/azure/core/tracing/_abstract_span.py index e4f6fd207e42..0eb9055d998e 100644 --- a/sdk/core/azure-core/azure/core/tracing/_abstract_span.py +++ b/sdk/core/azure-core/azure/core/tracing/_abstract_span.py @@ -144,7 +144,7 @@ def set_http_attributes(self, request: HttpRequestType, response: Optional[HttpR Add correct attributes for a http client span. :param request: The request made - :type request: HttpRequest + :type request: azure.core.rest.HttpRequest :param response: The response received by the server. Is None if no response received. :type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse """ @@ -268,7 +268,7 @@ def set_http_attributes( Add correct attributes for a http client span. :param request: The request made - :type request: HttpRequest + :type request: azure.core.rest.HttpRequest :param response: The response received from the server. Is None if no response received. :type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse """ diff --git a/sdk/core/azure-core/doc/azure.core.rst b/sdk/core/azure-core/doc/azure.core.rst index d53e95b33261..6d7b87f38f9d 100644 --- a/sdk/core/azure-core/doc/azure.core.rst +++ b/sdk/core/azure-core/doc/azure.core.rst @@ -35,7 +35,7 @@ azure.core.credentials :inherited-members: azure.core.credentials_async ---------------------- +---------------------------- .. automodule:: azure.core.credentials_async :members: @@ -50,7 +50,7 @@ azure.core.exceptions :undoc-members: azure.core.messaging -------------------- +-------------------- .. automodule:: azure.core.messaging :members: @@ -74,7 +74,7 @@ azure.core.settings :inherited-members: azure.core.serialization -------------------- +------------------------ .. automodule:: azure.core.serialization :members: @@ -82,7 +82,7 @@ azure.core.serialization :inherited-members: azure.core.rest -------------------- +--------------- .. automodule:: azure.core.rest :members: @@ -90,7 +90,7 @@ azure.core.rest :inherited-members: azure.core.utils -------------------- +---------------- .. automodule:: azure.core.utils :members: diff --git a/sdk/core/azure-core/doc/azure.rst b/sdk/core/azure-core/doc/azure.rst deleted file mode 100644 index 99a79dacec72..000000000000 --- a/sdk/core/azure-core/doc/azure.rst +++ /dev/null @@ -1,14 +0,0 @@ -azure package -============= - -.. automodule:: azure - :members: - :undoc-members: - :inherited-members: - -Subpackages ------------ - -.. toctree:: - - azure.core diff --git a/sdk/core/azure-core/pyproject.toml b/sdk/core/azure-core/pyproject.toml index a8848916dda3..3dd1f9d74a35 100644 --- a/sdk/core/azure-core/pyproject.toml +++ b/sdk/core/azure-core/pyproject.toml @@ -3,6 +3,7 @@ mypy = true type_check_samples = true verifytypes = true pyright = false +strict_sphinx = true # For test environments or static checks where a check should be run by default, not explicitly disabling will enable the check. # pylint is enabled by default, so there is no reason for a pylint = true in every pyproject.toml. #