Selaa lähdekoodia

use HTTPS for Petstore by default (#4652)

bubble
kyle 6 vuotta sitten
committed by GitHub
vanhempi
commit
bf77474a11
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
9 muutettua tiedostoa jossa 12 lisäystä ja 12 poistoa
  1. +1
    -1
      Dockerfile
  2. +1
    -1
      dev-helpers/index.html
  3. +1
    -1
      dist/index.html
  4. +3
    -3
      docker-run.sh
  5. +2
    -2
      docs/customization/custom-layout.md
  6. +1
    -1
      docs/usage/cors.md
  7. +1
    -1
      docs/usage/installation.md
  8. +1
    -1
      swagger-config.yaml
  9. +1
    -1
      test/e2e/helpers/index.html

+ 1
- 1
Dockerfile Näytä tiedosto

@@ -4,7 +4,7 @@ LABEL maintainer="fehguy"


ENV VERSION "v2.2.10" ENV VERSION "v2.2.10"
ENV FOLDER "swagger-ui-2.2.10" ENV FOLDER "swagger-ui-2.2.10"
ENV API_URL "http://petstore.swagger.io/v2/swagger.json"
ENV API_URL "https://petstore.swagger.io/v2/swagger.json"
ENV API_URLS "" ENV API_URLS ""
ENV API_KEY "**None**" ENV API_KEY "**None**"
ENV OAUTH_CLIENT_ID "**None**" ENV OAUTH_CLIENT_ID "**None**"


+ 1
- 1
dev-helpers/index.html Näytä tiedosto

@@ -43,7 +43,7 @@
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"] window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
// Build a system // Build a system
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
presets: [ presets: [
SwaggerUIBundle.presets.apis, SwaggerUIBundle.presets.apis,


+ 1
- 1
dist/index.html Näytä tiedosto

@@ -41,7 +41,7 @@


// Build a system // Build a system
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
deepLinking: true, deepLinking: true,
presets: [ presets: [


+ 3
- 3
docker-run.sh Näytä tiedosto

@@ -38,10 +38,10 @@ fi
if [[ -f $SWAGGER_JSON ]]; then if [[ -f $SWAGGER_JSON ]]; then
cp -s $SWAGGER_JSON $NGINX_ROOT cp -s $SWAGGER_JSON $NGINX_ROOT
REL_PATH="./$(basename $SWAGGER_JSON)" REL_PATH="./$(basename $SWAGGER_JSON)"
sed -i "s|http://petstore.swagger.io/v2/swagger.json|$REL_PATH|g" $INDEX_FILE
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$REL_PATH|g" $INDEX_FILE
sed -i "s|http://example.com/api|$REL_PATH|g" $INDEX_FILE sed -i "s|http://example.com/api|$REL_PATH|g" $INDEX_FILE
else else
sed -i "s|http://petstore.swagger.io/v2/swagger.json|$API_URL|g" $INDEX_FILE
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$API_URL|g" $INDEX_FILE
sed -i "s|http://example.com/api|$API_URL|g" $INDEX_FILE sed -i "s|http://example.com/api|$API_URL|g" $INDEX_FILE
fi fi


@@ -59,7 +59,7 @@ if [[ -n "$API_URLS" ]]; then
fi fi


# replace the PORT that nginx listens on if PORT is supplied # replace the PORT that nginx listens on if PORT is supplied
if [[ -n "${PORT}" ]]; then
if [[ -n "${PORT}" ]]; then
sed -i "s|8080|${PORT}|g" /etc/nginx/nginx.conf sed -i "s|8080|${PORT}|g" /etc/nginx/nginx.conf
fi fi




+ 2
- 2
docs/customization/custom-layout.md Näytä tiedosto

@@ -40,7 +40,7 @@ const OperationsLayoutPlugin = () => {
// Provide the plugin to Swagger-UI, and select OperationsLayout // Provide the plugin to Swagger-UI, and select OperationsLayout
// as the layout for Swagger-UI // as the layout for Swagger-UI
SwaggerUI({ SwaggerUI({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
plugins: [ OperationsLayoutPlugin ], plugins: [ OperationsLayoutPlugin ],
layout: "OperationsLayout" layout: "OperationsLayout"
}) })
@@ -85,7 +85,7 @@ const AugmentingLayoutPlugin = () => {
// Provide the plugin to Swagger-UI, and select AugmentingLayout // Provide the plugin to Swagger-UI, and select AugmentingLayout
// as the layout for Swagger-UI // as the layout for Swagger-UI
SwaggerUI({ SwaggerUI({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
plugins: [ AugmentingLayoutPlugin ], plugins: [ AugmentingLayoutPlugin ],
layout: "AugmentingLayout" layout: "AugmentingLayout"
}) })


+ 1
- 1
docs/usage/cors.md Näytä tiedosto

@@ -21,7 +21,7 @@ You can verify CORS support with one of three techniques:
- Curl your API and inspect the headers. For instance: - Curl your API and inspect the headers. For instance:


```bash ```bash
$ curl -I "http://petstore.swagger.io/v2/swagger.json"
$ curl -I "https://petstore.swagger.io/v2/swagger.json"
HTTP/1.1 200 OK HTTP/1.1 200 OK
Date: Sat, 31 Jan 2015 23:05:44 GMT Date: Sat, 31 Jan 2015 23:05:44 GMT
Access-Control-Allow-Origin: * Access-Control-Allow-Origin: *


+ 1
- 1
docs/usage/installation.md Näytä tiedosto

@@ -44,7 +44,7 @@ you could do something like this:
var SwaggerUIBundle = require('swagger-ui-dist').SwaggerUIBundle var SwaggerUIBundle = require('swagger-ui-dist').SwaggerUIBundle


const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
presets: [ presets: [
SwaggerUIBundle.presets.apis, SwaggerUIBundle.presets.apis,


+ 1
- 1
swagger-config.yaml Näytä tiedosto

@@ -1,5 +1,5 @@
--- ---
url: "http://petstore.swagger.io/v2/swagger.json"
url: "https://petstore.swagger.io/v2/swagger.json"
dom_id: "#swagger-ui" dom_id: "#swagger-ui"
validatorUrl: "https://online.swagger.io/validator" validatorUrl: "https://online.swagger.io/validator"
oauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html" oauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"

+ 1
- 1
test/e2e/helpers/index.html Näytä tiedosto

@@ -75,7 +75,7 @@
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"] window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
// Build a system // Build a system
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json",
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
presets: [ presets: [
SwaggerUIBundle.presets.apis, SwaggerUIBundle.presets.apis,


Ladataan…
Peruuta
Tallenna