forked from loafle/openapi-generator-original
[POSTMAN] Mark request header as disabled (#16028)
* Disable headers without a value * Update samples
This commit is contained in:
parent
30d6a2ff80
commit
2aa75802dc
@ -11,7 +11,8 @@
|
|||||||
{{#headerParams}}
|
{{#headerParams}}
|
||||||
{
|
{
|
||||||
"key": "{{baseName}}",
|
"key": "{{baseName}}",
|
||||||
"value": "{{schema.defaultValue}}"
|
"value": "{{schema.defaultValue}}",
|
||||||
|
"disabled": {{#schema.defaultValue}}false{{/schema.defaultValue}}{{^schema.defaultValue}}true{{/schema.defaultValue}}
|
||||||
}{{^-last}},{{/-last}}
|
}{{^-last}},{{/-last}}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
],
|
],
|
||||||
|
@ -494,10 +494,11 @@ public class PostmanCollectionCodegenTest {
|
|||||||
TestUtils.assertFileExists(path);
|
TestUtils.assertFileExists(path);
|
||||||
TestUtils.assertFileContains(path, "{ \"key\": \"Content-Type\", \"value\": \"application/json\"");
|
TestUtils.assertFileContains(path, "{ \"key\": \"Content-Type\", \"value\": \"application/json\"");
|
||||||
TestUtils.assertFileContains(path, "{ \"key\": \"Accept\", \"value\": \"application/json\"");
|
TestUtils.assertFileContains(path, "{ \"key\": \"Accept\", \"value\": \"application/json\"");
|
||||||
// header without default value
|
// header without default value (disabled: true)
|
||||||
TestUtils.assertFileContains(path, "{ \"key\": \"Custom-Header\", \"value\": \"\"");
|
TestUtils.assertFileContains(path, "{ \"key\": \"Custom-Header\", \"value\": \"\", \"disabled\": true");
|
||||||
// header with default value
|
// header with default value (disabled: false)
|
||||||
TestUtils.assertFileContains(path, "{ \"key\": \"Another-Custom-Header\", \"value\": \"abc\"");
|
TestUtils.assertFileContains(path, "{ \"key\": \"Another-Custom-Header\", \"value\": \"abc\", \"disabled\": false");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,19 +23,23 @@
|
|||||||
"header": [
|
"header": [
|
||||||
{
|
{
|
||||||
"key": "Content-Type",
|
"key": "Content-Type",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "Accept",
|
"key": "Accept",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "strCode",
|
"key": "strCode",
|
||||||
"value": "code_one"
|
"value": "code_one",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "strCode2",
|
"key": "strCode2",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"disabled": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
@ -134,15 +138,18 @@
|
|||||||
"header": [
|
"header": [
|
||||||
{
|
{
|
||||||
"key": "Accept",
|
"key": "Accept",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "strCode",
|
"key": "strCode",
|
||||||
"value": "code_one"
|
"value": "code_one",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "strCode2",
|
"key": "strCode2",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"disabled": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
@ -194,15 +201,18 @@
|
|||||||
"header": [
|
"header": [
|
||||||
{
|
{
|
||||||
"key": "Accept",
|
"key": "Accept",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "Custom-Header",
|
"key": "Custom-Header",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "Another-Custom-Header",
|
"key": "Another-Custom-Header",
|
||||||
"value": "abc"
|
"value": "abc",
|
||||||
|
"disabled": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
@ -247,11 +257,13 @@
|
|||||||
"header": [
|
"header": [
|
||||||
{
|
{
|
||||||
"key": "Content-Type",
|
"key": "Content-Type",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "Accept",
|
"key": "Accept",
|
||||||
"value": "application/json"
|
"value": "application/json",
|
||||||
|
"disabled": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user