You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I was trying to get the api-platform admin working with my api, but all api requests by the admin were to http://<resource_name>. Intermediate paths like /api/ and /v1/ are ignored.
My openapi json file specifies paths for each resource. Looking over the code the intermediate paths are stipped, I'm not sure why:
So "/api/v1/users" becomes "http://users" which of course is incorrect and very few schemas have just the resource name at the base path of the domain.
It seems the only way to have an intermediate path is to add a server to the openapi json document, but I don't see why this should be necessary when the openapi schema already includes the path to use. Also even if servers are specified, the code only picks the first server, so this means urls with different base paths will be converted to using the same base path based on the first server making it less flexible. Many common frameworks don't include servers when generating the openapi spec, making the api-platform admin unusable. It's also not mentioned in the README that a server needs to be specificied in order to have the correct urls.
I also find it strange that it pluralises it, why change the path at all? These paths are used by the admin to make api requests so they should be the same as that given in the schema.
Example
parseOpenApi3Documentation could accept a property:
Description
I was trying to get the api-platform admin working with my api, but all api requests by the admin were to http://<resource_name>. Intermediate paths like /api/ and /v1/ are ignored.
My openapi json file specifies paths for each resource. Looking over the code the intermediate paths are stipped, I'm not sure why:
So "/api/v1/users" becomes "http://users" which of course is incorrect and very few schemas have just the resource name at the base path of the domain.
It seems the only way to have an intermediate path is to add a server to the openapi json document, but I don't see why this should be necessary when the openapi schema already includes the path to use. Also even if servers are specified, the code only picks the first server, so this means urls with different base paths will be converted to using the same base path based on the first server making it less flexible. Many common frameworks don't include servers when generating the openapi spec, making the api-platform admin unusable. It's also not mentioned in the README that a server needs to be specificied in order to have the correct urls.
I also find it strange that it pluralises it, why change the path at all? These paths are used by the admin to make api requests so they should be the same as that given in the schema.
Example
parseOpenApi3Documentation could accept a property:
Or maybe it could accept a function:
The text was updated successfully, but these errors were encountered: