[POSTMAN] Include header description (#17292)

* Include header description

* Generate samples
This commit is contained in:
Beppe Catanese
2023-12-03 01:06:09 +01:00
committed by GitHub
parent 6657b2c5c2
commit 62faa53373
3 changed files with 16 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
{
"key": "{{baseName}}",
"value": "{{schema.defaultValue}}",
"description": "{{{description}}}",
"disabled": {{#schema.defaultValue}}false{{/schema.defaultValue}}{{^schema.defaultValue}}true{{/schema.defaultValue}}
}{{^-last}},{{/-last}}
{{/headerParams}}

View File

@@ -502,9 +502,9 @@ public class PostmanCollectionCodegenTest {
TestUtils.assertFileContains(path, "{ \"key\": \"Content-Type\", \"value\": \"application/json\"");
TestUtils.assertFileContains(path, "{ \"key\": \"Accept\", \"value\": \"application/json\"");
// header without default value (disabled: true)
TestUtils.assertFileContains(path, "{ \"key\": \"Custom-Header\", \"value\": \"\", \"disabled\": true");
TestUtils.assertFileContains(path, "{ \"key\": \"Custom-Header\", \"value\": \"\", \"description\": \"Custom HTTP header\", \"disabled\": true");
// header with default value (disabled: false)
TestUtils.assertFileContains(path, "{ \"key\": \"Another-Custom-Header\", \"value\": \"abc\", \"disabled\": false");
TestUtils.assertFileContains(path, "{ \"key\": \"Another-Custom-Header\", \"value\": \"abc\", \"description\": \"Custom HTTP header with default\", \"disabled\": false");
}

View File

@@ -24,21 +24,25 @@
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"disabled": false
},
{
"key": "Accept",
"value": "application/json",
"description": "",
"disabled": false
},
{
"key": "strCode",
"value": "code_one",
"description": "Code as header",
"disabled": false
},
{
"key": "strCode2",
"value": "",
"description": "Code as header2",
"disabled": true
}
],
@@ -92,6 +96,7 @@
{
"key": "Accept",
"value": "application/json",
"description": "",
"disabled": false
}
],
@@ -140,16 +145,19 @@
{
"key": "Accept",
"value": "application/json",
"description": "",
"disabled": false
},
{
"key": "strCode",
"value": "code_one",
"description": "Code as header",
"disabled": false
},
{
"key": "strCode2",
"value": "",
"description": "Code as header2",
"disabled": true
}
],
@@ -203,11 +211,13 @@
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"disabled": false
},
{
"key": "Accept",
"value": "application/json",
"description": "",
"disabled": false
}
],
@@ -250,16 +260,19 @@
{
"key": "Accept",
"value": "application/json",
"description": "",
"disabled": false
},
{
"key": "Custom-Header",
"value": "",
"description": "Custom HTTP header",
"disabled": true
},
{
"key": "Another-Custom-Header",
"value": "abc",
"description": "Custom HTTP header with default",
"disabled": false
}
],