Я использую Api Platform с Symfony 4 и хочу создать собственную конечную точку. Все работает нормально, но я не могу изменить 2 вещи: тело и формат ответа (в документации openapi).
Параметры и коды состояния ответов работают просто отлично.
* "login"={
* "route_name"="api_login",
* "method" = "post",
* "openapi_context" = {
* "parameters" = {},
* "body" = {
* "description" ="Username and password",
* "schema" = {
* "type" = "object",
* "required" = {"email","password"},
* "properties" = {
* "email" = {
* "type" = "string"
* },
* "password" = {
* "type" = "string"
* }
* }
* }
* },
* "responses" = {
* "200" = {
* "description" = "User logged in",
* "schema" = {
* "type" = "object",
* "required" = {
* "token",
* "refresh_token"
* },
* "properties" = {
* "token" = {
* "type" = "string"
* },
* "refresh_token" = {
* "type" = "string"
* }
* }
* }
* },
* "401" = {
* "description" = "invalid password or email"
* }
* },
* "summary" = "Login user in application",
* "consumes" = {
* "application/json",
* "text/html",
* },
* "produces" = {
* "application/json"
* }
* }
* }