@@ -107,6 +107,28 @@ class ODataV4Format(object):
107107
108108 http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
109109
110+ Example of JSON:
111+
112+ error: {
113+ "code": "ValidationError",
114+ "message": "One or more fields contain incorrect values: ",
115+ "details": [
116+ {
117+ "code": "ValidationError",
118+ "target": "representation",
119+ "message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\\ \\ d+)?$'.
120+ Path 'host', line 1, position 297."
121+ },
122+ {
123+ "code": "ValidationError",
124+ "target": "representation",
125+ "message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
126+ https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
127+ (schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)."
128+ }
129+ ]
130+ }
131+
110132 :param dict json_object: A Python dict representing a ODataV4 JSON
111133 :ivar str ~.code: Its value is a service-defined error code.
112134 This code serves as a sub-status for the HTTP error code specified in the response.
@@ -160,7 +182,11 @@ def error(self):
160182 return self
161183
162184 def __str__ (self ):
163- return "({}) {}" .format (self .code , self .message )
185+ return "({}) {}\n {}" .format (
186+ self .code ,
187+ self .message ,
188+ self .message_details ()
189+ )
164190
165191 def message_details (self ):
166192 """Return a detailled string of the error.
0 commit comments