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

Open API Specification - Consume Server Details & update base url with respect to server details #1440

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

samyakOO7
Copy link
Collaborator

servers:
  - url: https://api.test.example.com/v1/pet
    description: Hello

Servers Section Usage

In our implementation, we utilize the servers section of the OpenAPI configuration file to extract server details. Each server entry includes a url and a description. The server URL to be used is determined by passing the --description command-line argument, applicable for both stub generation and testing.

For Stub Generation:

  • The chosen server's URL is used to extract its prefix, which acts as the stubBaseURL.
  • Example: Given the URL https://api.test.example.com/v1/pet, the prefix /v1/pet is extracted and used as the stubBaseURL.

For Testing:

  • The full server URL, as defined in the OpenAPI specification, is directly used for testing.
  • This ensures that the API tests align precisely with the specification.

This process ensures flexibility in selecting server configurations while maintaining compliance with the OpenAPI specification.

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

Successfully merging this pull request may close these issues.

1 participant