Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoints uri's are not relative to the server>url #789

Open
vaidas-lungis opened this issue Feb 29, 2024 · 0 comments
Open

Endpoints uri's are not relative to the server>url #789

vaidas-lungis opened this issue Feb 29, 2024 · 0 comments
Labels

Comments

@vaidas-lungis
Copy link

Jane version(s) affected: v7.6.0

Description
All endpoint uri's are generated with / prefix (relative to the root), and it breaks OAS3.0 specification

All API endpoints are relative to the base URL

Screenshot 2024-02-29 at 11 39 48

At the end final uri is generated by the RFC 3986, section 5.2

Screenshot 2024-02-29 at 11 39 24

So it is impossible to have a server.url value with path in it. Only first two options are possible from the example.

Hence by the applying changes, 3rd and 4th option will be possible allowing more flexibility and following the OAS3.0 specification.

How to reproduce

openapi: 3.0.1
info:
  title: exmaple
  version: 1.0.0
servers:
  - url: https://server.localhost/api/v3
paths:
  /users:
    get:
      summary: Get users
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              {}          

Possible Solution
Trim leading / from path value.
Update Generator class Jane\Component\OpenApiCommon\Guesser\Guess\OperationGuess

$this->path = ltrim($path, '/');

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant