#%RAML 1.0 title: Премьер Тур version: v1 protocols: [ HTTPS ] baseUri: https://premier-tur.com/api/{version} mediaType: application/vnd.api+json types: DateTime_1C: !include ./types/DateTime_1C.raml Date_1C: !include ./types/Date_1C.raml EmptyString: !include ./types/EmptyString.raml EmptyArray: !include ./types/EmptyArray.raml OrderCanceled: !include ./types/OrderCanceled.raml AgentCompany: !include ./types/AgentCompany.raml OrderAgent: !include ./types/OrderAgent.raml OrderPay: !include ./types/OrderPay.raml Phone: !include ./types/Phone.raml Email: !include ./types/Email.raml Feedback: !include ./types/Feedback.raml Room: !include ./types/Room.raml Price: !include ./types/Price.raml Order: !include ./types/Order.raml Image: !include ./types/Image.raml traits: Pagination: !include ./traits/Pagination.raml Object: !include ./traits/Object.raml Price: !include ./traits/Price.raml Feedback: !include ./traits/Feedback.raml Room: !include ./traits/Room.raml documentation: - title: Введение content: | * REST API для сайта https://premier-tur.com документируется по стандарту RAML 1.0. Сделить за разработкой стандарта можно в репозитории на GitHub: https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md * Проектирование документации ведется при помощи сервиса API Designer от компании MuleSoft. С инструментом документирования можно ознакомиться тут: https://www.mulesoft.com/platform/api/anypoint-designer * За генерацию документации из формата RAML в HTML страницу отвечает библиотека raml2html для Node.JS. Исходный код проекта доступен на GitHub: https://github.com/raml2html/raml2html /orders: description: Работа с базой заказов get: description: Получение списка заказов is: [ Pagination: { typeName: Order} ] responses: 200: body: application/json: example: !include ./examples/orders/pagination.raml /{code.full}: get: description: Получение инфомрации о заказе is: [ Object: { typeName: Order} ] responses: 200: body: application/json: examples: Недооформлен: !include ./examples/orders/object/notend.raml Удален: !include ./examples/orders/object/deleted.raml Отменен: !include ./examples/orders/object/canceled.raml Подтвержден: !include ./examples/orders/object/confirmed.raml Оплачен: !include ./examples/orders/object/payed.raml Выполнен: !include ./examples/orders/object/done.raml Новый: !include ./examples/orders/object/new.raml Клиентский: !include ./examples/orders/object/client.raml Бонусы: !include ./examples/orders/object/bonus.raml /prices: description: Работа с прайсами get: description: Получение списка прайсов is: [ Pagination: { typeName: Price} ] queryParameters: params: type: object properties: archive: type: integer required: false minimum: 0 maximum: 1 example: 1 description: | Если ничего не задано, то выводятся все прайсы Если задано 1, то выводятся только архивные прайся Если задано 0, то выводятся только активные прайсы responses: 200: body: application/json: example: !include ./examples/prices/pagination.raml /{id}: get: description: Получение информации о конкретном прайсе is: [ Object: { typeName: Price} ] responses: 200: body: application/json: examples: Пример: !include ./examples/prices/object.raml /rooms: description: Работа с номерным фондом get: description: Получение списка номеров is: [ Pagination: { typeName: Room} ] responses: 200: body: application/json: example: !include ./examples/rooms/pagination.raml /{id}: get: description: Получение информации о конкретном номере is: [ Object: { typeName: Room} ] responses: 200: body: application/json: examples: Пример: !include ./examples/rooms/object.raml /feedback: description: Данные для обратной связи с клиентами get: description: Получение списка данных из форм обратной связи is: [ Pagination: { typeName: Feedback} ] responses: 200: body: application/json: example: !include ./examples/feedback/pagination.raml post: description: Добавление нового запроса на обратную связь is: [ Feedback: { typeName: Feedback} ] queryParameters: params: type: object properties: source: type: string required: false example: example.com description: | Источник заявки data: type: object properties: fio: type: string required: true description: ФИО клиента phone: type: Phone required: true description: Контактный телефон клиента email: type: Email required: false description: Email клиента ip: type: string required: false description: IP клиента ua: type: string required: false description: USER AGENT клиента type: type: string required: true description: | Тип данных (в зависимости от источника source, возможные типы могут отличаться) responses: 200: body: application/json: examples: Пример: !include ./examples/feedback/object.raml /{id}: get: description: Получение инфомрации о запросе на обратную связь is: [ Feedback: { typeName: Feedback} ] responses: 200: body: application/json: examples: Пример: !include ./examples/feedback/object.raml