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

Added fix for basic relative URLs and support variables in servers URLs #69

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

udamir
Copy link

@udamir udamir commented Mar 3, 2021

I don't want to put a specific url of server in OpenAPI file, as it can be used in different environments, so I use the following:

openapi: '3.0.2'
servers:
  - url: /api

On init method I get the error:

TypeError [ERR_INVALID_URL]: Invalid URL: /api
    at onParseError (internal/url.js:257:9)
    at new URL (internal/url.js:333:5)

@udamir udamir changed the title pathname vs server url (fix) Added fix for basic relative URLs and support variables in servers URLs Mar 4, 2021
@udamir
Copy link
Author

udamir commented Mar 4, 2021

This resolves #59

Copy link
Collaborator

@kobik kobik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR @udamir!

please see my comments

src/index.js Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
test/openapi3/general/pets-general.yaml Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
Move this improvement to next version
@udamir udamir requested a review from kobik March 18, 2021 13:26
@goldsziggy
Copy link

+1 on this fix

@kibertoad kibertoad closed this Mar 27, 2021
@kibertoad kibertoad reopened this Mar 27, 2021
@kibertoad
Copy link
Collaborator

CI is passing locally, merging.

@kibertoad
Copy link
Collaborator

@kobik Could you please merge this?

@kibertoad kibertoad closed this Mar 27, 2021
@kibertoad kibertoad reopened this Mar 27, 2021
@udamir
Copy link
Author

udamir commented Mar 27, 2021

What I need to do to pass ci/circleci checks?

@goldsziggy
Copy link

Bump on this change -- anything blocking it besides a review? I can add a commit if needed.

@kibertoad
Copy link
Collaborator

@udamir @goldsziggy This still needs tests, and also conflicts need to be resolved now that https://github.com/PayU/api-schema-builder/pull/67/files is merged, which I believe will be superseded by this PR - but you can definitely reuse the tests that were created for that PR.

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

Successfully merging this pull request may close these issues.

4 participants