Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.8

Код возврата: «400».

expand
Раскрытьcode
titleФормат ответа в случае неправильной версии API (JSON Scheme) REST API
collapsetrue
{
    

    "properties": {
        

        "error": {
            

            "description": "Контейнер ошибки",
            

            "properties":  {
                

                "code":       {
                    

                    "description": "Общее описание ошибки",
                    

                    "type":        "string",
                    

                    "value":       "unsupported_version"
                

                },
                

                "meta": {
                    

                    "description": "Дополнительные данные об ошибке",
                    

                    "type":        "object",
                    

                    "properties":  {
                        

                        "supported_versions": {
                            

                            "description": "Массив поддерживаемых версий",
                            

                            "type":        "array",
                            

                            "items": {
                                

                                "description": "Поддерживаемая версия",
                                

                                "type": "string"

                            }

                        }

                    }

                }

            }

        }

    }

}


                            }
                        }
                    }
                }
            }
        }
    }
}

{

    expand
Блок кода
titleФормат ответа в случае ошибки валидации запроса (JSON Scheme) REST API
collapsetrue
{
    "properties": {
        

        "error": {
            

            "description": "Контейнер ошибки",
            

            "properties":  {
                

                "code":       {
                    

                    "description": "Общее описание ошибки",
                    

                    "type":        "string",
                    

                    "value":       "validation"
                

                },
                

                "meta": {
                    

                    "description": "Дополнительные данные об ошибке",
                    

                    "type":        "object",
                    

                    "properties":  {
                        

                        "validation": {
                            

                            "description": "Название полей модели",
                            

                            "type":        "object",
                            

                            "properties":  {
                                

                                "field":     {
                                    

                                    "description": "Поле модели",
                                    

                                    "type":        "array",
                                    

                                    "items":       {
                                        

                                        "description": "Ошибка",
                                        

                                        "type":        "string",
                                        

                                        "values": [
                                            

                                            "not_unique_field",
                                            

                                            "too_short",
                                            

                                            "too_long",
                                            

                                            "wrong_length",
                                            

                                            "repeat_exactly",
                                            

                                            "required",
                                            

                                            "not_exist_in_list",
                                            

                                            "invalid",
                                            

                                            "contains_child",
                                            

                                            "contains_items",
                                            

                                            "parent_own_child",
                                            

                                            "unique",
                                            

                                            "not_valid_json",
                                            

                                            "invalid_cron_format",
                                            

                                            "read_only",
                                            

                                            "parent_self_set_current",
                                            

                                            "empty"

                                        ]

                                    }


                                        ]
                                    }
                                },
                                


                                "sub_model": {
                                    

                                    "description": "Название вложенной модели",
                                    

                                    "type":        "object",
                                    

                                    "$ref":       "#/properties/error/properties/meta/properties/validation"

                                }

                            }

                        }

                    }

                }

            }

        }

    }

}


                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
expand
Блок кода
titleПример ошибки при указании неправильной версии REST API
collapsetrue

 {

    
 {
    "error": {
        

        "code": "unsupported_version",
        

        "meta": {
            

            "supported_versions": ["2", "3"]

        }

    }

}


        }
    }
}

 {

    
Блок кода
titleПример ошибки проверки на уникальность имени эталонной выгрузки REST API
collapsetrue
{
    "error": {
        

        "code": "validation",
        

        "meta": {
            

            "validation":    {
                

                "DISPLAY_NAME": ["unique"]
            

            },
            

            "unique_models": [

                {

                    

                {
                    "FINGERPRINT_ID": "0123456789ABCDEF",
                    

                    "DISPLAY_NAME":   "test"

                }

            ]

        }

    }

}

 

 

...


                }
            ]
        }
    }
}