Skip to content

Commit

Permalink
Setting the endpoint at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
boazhuisman committed Mar 25, 2020
1 parent 66ba464 commit cacaba3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 2 additions & 0 deletions server/server.go
Expand Up @@ -34,6 +34,8 @@ func NewServer(serviceEndpoint, serviceSpecPath string, defaultReturnLimit, maxR
log.Fatal("Specification initialisation error:", err)
return nil, err
}
// Set endpoint
swagger.AddServer(&openapi3.Server{URL: serviceEndpoint, Description: "Production server"})

server := &Server{ServiceEndpoint: serviceEndpoint, ServiceSpecPath: serviceSpecPath, MaxReturnLimit: maxReturnLimit, DefaultReturnLimit: defaultReturnLimit, Swagger: swagger}

Expand Down
12 changes: 0 additions & 12 deletions spec/wfs1.0.0.json
Expand Up @@ -1216,18 +1216,6 @@
}
}
},
"servers": [
{
"url": "/{type}/oaf/v1_0",
"description": "Production server",
"variables" : {
"type" : {
"default" : "bgt",
"description" : "Different types of the WFS may be launched, i.e. bgt or bgt-hist."
}
}
}
],
"tags": [
{
"description": "essential characteristics of this API",
Expand Down
7 changes: 0 additions & 7 deletions spec/wfs1.0.0.yml
Expand Up @@ -20,13 +20,6 @@ info:
license:
name: CC-BY 4.0 license
url: 'https://creativecommons.org/licenses/by/4.0/'
servers:
- url: '/{type}/oaf/v1_0'
description: Production server
variables:
type:
default: bgt
description: Different types of the WFS may be launched, i.e. bgt or bgt-hist.
tags:
- name: Capabilities
description: |-
Expand Down

0 comments on commit cacaba3

Please sign in to comment.