Skip to content

Commit 81339ad

Browse files
authored
add editor.swagger.io
1 parent 294d914 commit 81339ad

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,52 @@ curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petsto
676676
```
677677
Then you will receieve a JSON response with the URL to download the zipped code.
678678

679+
To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body:
680+
```
681+
{
682+
"options": {},
683+
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
684+
}
685+
```
686+
in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`:
687+
688+
For example, `curl https://generator.swagger.io/api/gen/clients/python` returns
689+
```
690+
{
691+
"packageName":{
692+
"opt":"packageName",
693+
"description":"python package name (convention: snake_case).",
694+
"type":"string",
695+
"default":"swagger_client"
696+
},
697+
"packageVersion":{
698+
"opt":"packageVersion",
699+
"description":"python package version.",
700+
"type":"string",
701+
"default":"1.0.0"
702+
},
703+
"sortParamsByRequiredFlag":{
704+
"opt":"sortParamsByRequiredFlag",
705+
"description":"Sort method arguments to place required parameters before optional parameters.",
706+
"type":"boolean",
707+
"default":"true"
708+
}
709+
}
710+
```
711+
To set package name to `pet_store`, the HTTP body of the request is as follows:
712+
```
713+
{
714+
"options": {
715+
"packageName": "pet_store"
716+
},
717+
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"
718+
}
719+
```
720+
and here is the curl command:
721+
```
722+
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
723+
```
724+
679725
Guidelines for Contribution
680726
---------------------------
681727

0 commit comments

Comments
 (0)