forked from loafle/openapi-generator-original
Change default value of 'pathParamsAsVariables' config option (#16404)
* Change default value for config option * Regenerate samples
This commit is contained in:
@@ -35,7 +35,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC
|
||||
public static final String FOLDER_STRATEGY_DEFAULT_VALUE = "Tags";
|
||||
// Select whether to create Postman variables for path templates
|
||||
public static final String PATH_PARAMS_AS_VARIABLES = "pathParamsAsVariables";
|
||||
public static final Boolean PATH_PARAMS_AS_VARIABLES_DEFAULT_VALUE = true;
|
||||
public static final Boolean PATH_PARAMS_AS_VARIABLES_DEFAULT_VALUE = false;
|
||||
|
||||
public static final String POSTMAN_FILE_DEFAULT_VALUE = "postman.json";
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ public class PostmanCollectionCodegenTest {
|
||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
||||
.setGeneratorName("postman-collection")
|
||||
.setInputSpec("src/test/resources/3_0/postman-collection/SampleProject.yaml")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.PATH_PARAMS_AS_VARIABLES, true)
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
@@ -165,6 +166,7 @@ public class PostmanCollectionCodegenTest {
|
||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
||||
.setGeneratorName("postman-collection")
|
||||
.setInputSpec("src/test/resources/3_0/postman-collection/BasicVariablesInExample.yaml")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.PATH_PARAMS_AS_VARIABLES, true)
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
@@ -197,6 +199,7 @@ public class PostmanCollectionCodegenTest {
|
||||
.setGeneratorName("postman-collection")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.POSTMAN_VARIABLES, false)
|
||||
.setInputSpec("src/test/resources/3_0/postman-collection/BasicVariablesInExample.yaml")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.PATH_PARAMS_AS_VARIABLES, true)
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
@@ -224,7 +227,6 @@ public class PostmanCollectionCodegenTest {
|
||||
|
||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
||||
.setGeneratorName("postman-collection")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.PATH_PARAMS_AS_VARIABLES, false)
|
||||
.setInputSpec("src/test/resources/3_0/postman-collection/SampleProject.yaml")
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
|
||||
@@ -277,6 +279,7 @@ public class PostmanCollectionCodegenTest {
|
||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
||||
.setGeneratorName("postman-collection")
|
||||
.setInputSpec("src/test/resources/3_0/postman-collection/SampleProject.yaml")
|
||||
.addAdditionalProperty(PostmanCollectionCodegen.PATH_PARAMS_AS_VARIABLES, true)
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"name": "default",
|
||||
"item": [
|
||||
{
|
||||
"name": "/users/{{userId}} (DEPRECATED)",
|
||||
"name": "/users/{userId} (DEPRECATED)",
|
||||
"description": "Update the information of an existing user.",
|
||||
"item": [
|
||||
{
|
||||
@@ -52,13 +52,13 @@
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/users/{{userId}}",
|
||||
"raw": "{{baseUrl}}/users/{userId}",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"users",
|
||||
"{{userId}}"
|
||||
"{userId}"
|
||||
],
|
||||
"variable": [
|
||||
{
|
||||
@@ -81,7 +81,7 @@
|
||||
"name": "advanced",
|
||||
"item": [
|
||||
{
|
||||
"name": "/groups/{{groupId}}",
|
||||
"name": "/groups/{groupId}",
|
||||
"description": "Get group of users",
|
||||
"item": [
|
||||
{
|
||||
@@ -105,13 +105,13 @@
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/groups/{{groupId}}",
|
||||
"raw": "{{baseUrl}}/groups/{groupId}",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"groups",
|
||||
"{{groupId}}"
|
||||
"{groupId}"
|
||||
],
|
||||
"variable": [
|
||||
{
|
||||
@@ -129,7 +129,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "/users/{{userId}}",
|
||||
"name": "/users/{userId}",
|
||||
"description": "Retrieve the information of the user with the matching user ID.",
|
||||
"item": [
|
||||
{
|
||||
@@ -163,13 +163,13 @@
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/users/{{userId}}",
|
||||
"raw": "{{baseUrl}}/users/{userId}",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"users",
|
||||
"{{userId}}"
|
||||
"{userId}"
|
||||
],
|
||||
"variable": [
|
||||
{
|
||||
@@ -328,20 +328,10 @@
|
||||
"value": "v1",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "groupId",
|
||||
"value": "1",
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"key": "port",
|
||||
"value": "5000",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "userId",
|
||||
"value": "",
|
||||
"type": "number"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user