docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Internal swagger structures doesn't support recursive schema definitions

Open sashaozz opened this issue 10 years ago • 1 comments

Generating RestApi documentation in docfx 1.6.1 results in Error:System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonSerializationException: Self referencing loop detected with type 'Microsoft.DocAsCode.EntityModel.Swagger.Internal.SwaggerObject'. Path ''. for the following type in definitions because of self-referencing field InnerException

"ApiExceptionError": {
            "description": "Ошибка времени выполнения (run-time exception)",
            "type": "object",
            "properties": {
                "ExceptionMessage": {
                    "description": "Сообщение",
                    "type": "string"
                },
                "StackTrace": {
                    "description": "StackTrace",
                    "type": "string"
                },
                "ExceptionType": {
                    "description": "Тип исключения",
                    "type": "string"
                },
                "InnerException": {
                    "$ref": "#/definitions/ApiExceptionError",
                    "description": "InnerException"
                },
                "Message": {
                    "description": "Сообщение",
                    "type": "string"
                },
                "ReasonCode": {
                    "description": "Код ошибки",
                    "type": "string"
                },
                "UserMessage": {
                    "description": "Пользовательское сообщение",
                    "type": "string"
                }
            }
        }

sashaozz avatar Mar 20 '16 09:03 sashaozz

@sashaozz we fixed via #453 #464 , DocFX supports swagger recursive reference now.

The code is already in dev branch, will release at July 18th.

hellosnow avatar Jul 06 '16 06:07 hellosnow