Skip to content

Commit 4677fea

Browse files
authored
Merge pull request #10427 from b0uh/fix/readme-petstore-url
[Documentation] Use HTTPS for petstore urls
2 parents e6d69ab + 999cf41 commit 4677fea

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ To install, run `brew install swagger-codegen`
236236

237237
Here is an example usage:
238238
```sh
239-
swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
239+
swagger-codegen generate -i https://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/
240240
```
241241

242242
### Docker
@@ -301,7 +301,7 @@ sleep 5
301301
GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID)
302302
# Execute an HTTP request and store the download link
303303
RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
304-
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
304+
"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
305305
}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"')
306306
# Download the generated zip and redirect to a file
307307
curl $RESULT > result.zip
@@ -321,7 +321,7 @@ Example:
321321

322322
```sh
323323
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
324-
-i http://petstore.swagger.io/v2/swagger.json \
324+
-i https://petstore.swagger.io/v2/swagger.json \
325325
-l go \
326326
-o /local/out/go
327327
```
@@ -332,17 +332,17 @@ The generated code will be located under `./out/go` in the current directory.
332332

333333
## Getting Started
334334

335-
To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following
335+
To generate a PHP client for https://petstore.swagger.io/v2/swagger.json, please run the following
336336
```sh
337337
git clone https://github.com/swagger-api/swagger-codegen
338338
cd swagger-codegen
339339
mvn clean package
340340
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
341-
-i http://petstore.swagger.io/v2/swagger.json \
341+
-i https://petstore.swagger.io/v2/swagger.json \
342342
-l php \
343343
-o /var/tmp/php_api_client
344344
```
345-
(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`)
345+
(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`)
346346

347347
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.jar)
348348

@@ -353,7 +353,7 @@ To get a list of PHP specified options (which can be passed to the generator wit
353353
## Generators
354354

355355
### To generate a sample client library
356-
You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows:
356+
You can build a client against the swagger sample [petstore](https://petstore.swagger.io) API as follows:
357357

358358
```sh
359359
./bin/java-petstore.sh
@@ -365,7 +365,7 @@ This will run the generator with this command:
365365

366366
```sh
367367
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
368-
-i http://petstore.swagger.io/v2/swagger.json \
368+
-i https://petstore.swagger.io/v2/swagger.json \
369369
-l java \
370370
-o samples/client/petstore/java
371371
```
@@ -463,7 +463,7 @@ Note the `myClientCodegen` is an option now, and you can use the usual arguments
463463
```sh
464464
java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
465465
io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\
466-
-i http://petstore.swagger.io/v2/swagger.json \
466+
-i https://petstore.swagger.io/v2/swagger.json \
467467
-o myClient
468468
```
469469

@@ -595,7 +595,7 @@ Each of these files creates reasonable defaults so you can get running quickly.
595595

596596
```sh
597597
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
598-
-i http://petstore.swagger.io/v2/swagger.json \
598+
-i https://petstore.swagger.io/v2/swagger.json \
599599
-l java \
600600
-o samples/client/petstore/java \
601601
-c path/to/config.json
@@ -699,7 +699,7 @@ or
699699

700700
You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example:
701701

702-
http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json
702+
http://online.swagger.io/validator/debug?url=https://petstore.swagger.io/v2/swagger.json
703703

704704
### Generating dynamic html api documentation
705705

@@ -775,15 +775,15 @@ One can also generate API client or server using the online generators (https://
775775

776776
For example, to generate Ruby API client, simply send the following HTTP request using curl:
777777
```sh
778-
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
778+
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby
779779
```
780780
Then you will receive a JSON response with the URL to download the zipped code.
781781

782782
To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body:
783783
```json
784784
{
785785
"options": {},
786-
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
786+
"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
787787
}
788788
```
789789
in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`:
@@ -817,12 +817,12 @@ To set package name to `pet_store`, the HTTP body of the request is as follows:
817817
"options": {
818818
"packageName": "pet_store"
819819
},
820-
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
820+
"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"
821821
}
822822
```
823823
and here is the curl command:
824824
```sh
825-
curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python
825+
curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python
826826
```
827827

828828
Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g.

0 commit comments

Comments
 (0)