question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

path specific URL endpoint using server object url

See original GitHub issue

In below given example, i need to have customized url for the resource “user-enableuser”. i thought in openapi 3.0.0, it can be achieved through server object for each path. Please let me know what i am missing here

"paths": {
    "/user-enableuser": {
      "post": {
		"servers": [{
			"url": "https://x.x.x.x/user"
		}],
        "tags": [
          "user"
        ],
        "summary": " ",
        "operationId": "user@ENABLE",
        "produces": [
          "application/xml"
        ],
        "consumes": [
          "application/xml"
        ],
        "parameters": [
          {
            "schema": {},
            "description": " ",
            "name": "body",
            "required": true,
            "in": "body"
          }
        ],
        "responses": {}
      }
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeRalphsoncommented, Sep 26, 2017

I think your best bet is to describe the requestBody as oneOf an array of schemas, as presumably the server disambiguates the operation required based on the content of the body, or some query or header parameter?

Alternatively, you could use differing content-types for the requestBody.

There is also this proposal which is marked for possible future consideration.

1reaction
MikeRalphsoncommented, Sep 26, 2017

If you check this issue on the swagger-ui repository - you can see that this functionality is still in the backlog of work to be done:

 Path and operation-level servers are not displayed

Use a UI similar to the top-level servers. Implement functionality for Try-It-Out simultaneously.

If you need further information, you should raise an issue on the repository for the tooling concerned, not the specification itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Server and Base Path - Swagger
All API endpoints are relative to the base URL. For example, assuming the base URL of https://api.example.com/v1 , the /users endpoint refers to...
Read more >
API Servers - OpenAPI Documentation - GitHub Pages
The Server Object provides the base URLs where the API is being served. It can be found in the servers array present in...
Read more >
URL.pathname - Web APIs - MDN Web Docs
The pathname property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of...
Read more >
Website endpoints - Amazon Simple Storage Service
To request a specific object that is stored at the root level in the bucket, use the following URL structure. http:// bucket-name .s3-website....
Read more >
How to get full server URL from any endpoint handler in Gin
c.Request.Host+c.Request.URL.Path should work but the scheme has to be determined. package main import ( "fmt" "github.com/gin-gonic/gin" ) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found