Skip to content

Commit 397aa0a

Browse files
author
Ankit Saini
authored
Merge pull request #670 from postmanlabs/release/1.4.0
Release/1.4.0
2 parents c951cbe + e6eabff commit 397aa0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4093
-381
lines changed

.github/workflows/integration.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Unit-Tests:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Get Code
10+
uses: actions/checkout@v3
11+
- name: Setup Node JS
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '8.x'
15+
- name: Install system dependencies
16+
run: npm run cirequirements
17+
- name: Install package dependencies
18+
run: npm install
19+
- name: Install dependencies for individual codegens
20+
run: npm run deepinstall dev
21+
- name: Run tests
22+
run: npm run test

.travis.yml

-10
This file was deleted.

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v1.4.0 (February 6, 2023)
2+
* Add support for C# HttpClient Codegen
3+
* Use short options in CURL as long as possible (9511)[https://github.com/postmanlabs/postman-app-support/issues/9511]
4+
* Do not add HTTP method explicitly in CURL when not required (10581)[https://github.com/postmanlabs/postman-app-support/issues/10581]
5+
* Remove usage of semaphore from Swift Codegen (10053)[https://github.com/postmanlabs/postman-app-support/issues/10053]
6+
17
v1.3.0 (December 16, 2022)
28
* Update C# restsharp codegen to support (107)[https://restsharp.dev/v107/]
39
* Fixes an issue where HTTP code snippet was generating wrong boundaries (11084)[https://github.com/postmanlabs/postman-app-support/issues/11084]

README.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ List of supported code generators:
1818
| Language | Variant |
1919
|-----------|---------------|
2020
| C | libcurl |
21+
| C# | HttpClient |
2122
| C# | RestSharp |
2223
| cURL | cURL |
2324
| Dart | http |
@@ -49,16 +50,24 @@ List of supported code generators:
4950
| Swift | URLSession |
5051
## Table of contents
5152

52-
1. [Getting Started](#getting-started)
53-
2. [Prerequisite](#prerequisite)
54-
3. [Usage](#usage)
55-
1. [Using postman code generators as a Library](#using-postman-code-generators-as-a-library)
56-
4. [Development](#development)
57-
1. [Installing Dependencies](#installing-dependencies)
58-
2. [Testing](#testing)
59-
3. [Packaging](#packaging)
60-
7. [Contributing](#contributing)
61-
8. [License](#license)
53+
- [postman-code-generators ![Build Status](https://travis-ci.com/postmanlabs/postman-code-generators)](#postman-code-generators-)
54+
- [Table of contents](#table-of-contents)
55+
- [Getting Started](#getting-started)
56+
- [Prerequisite](#prerequisite)
57+
- [Usage](#usage)
58+
- [Using postman-code-generators as a Library](#using-postman-code-generators-as-a-library)
59+
- [getLanguageList](#getlanguagelist)
60+
- [Example:](#example)
61+
- [getOptions](#getoptions)
62+
- [Example:](#example-1)
63+
- [convert](#convert)
64+
- [Example:](#example-2)
65+
- [Development](#development)
66+
- [Installing dependencies](#installing-dependencies)
67+
- [Testing](#testing)
68+
- [Packaging](#packaging)
69+
- [Contributing](#contributing)
70+
- [License](#license)
6271

6372
## Getting Started
6473
To install postman-code-generators as your dependency

codegens/csharp-httpclient/.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.DS_Store
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Coverage directory used by tools like istanbul
10+
.coverage
11+
12+
# node-waf configuration
13+
.lock-wscript
14+
15+
16+
# Dependency directories
17+
node_modules/
18+
jspm_packages/
19+
20+
# Test Project directories
21+
testProject/
22+
23+
# Typescript v1 declaration files
24+
typings/
25+
26+
# Optional npm cache directory
27+
.npm
28+
29+
# Optional eslint cache
30+
.eslintcache
31+
32+
# Optional REPL history
33+
.node_repl_history
34+
35+
# Output of 'npm pack'
36+
*.tgz
37+
38+
# Yarn Integrity file
39+
.yarn-integrity
40+
41+
# dotenv environment variables file
42+
.env
43+
44+
out/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true,
4+
"dictionaries": ["jsdoc", "closure"]
5+
},
6+
"source": {
7+
"include": ["lib"],
8+
"includePattern": ".+\\.js(doc)?$",
9+
"excludePattern": "(^|\\/|\\\\)_"
10+
},
11+
12+
"plugins": [
13+
"plugins/markdown"
14+
],
15+
16+
"templates": {
17+
"cleverLinks": false,
18+
"monospaceLinks": false,
19+
"highlightTutorialCode" : true
20+
},
21+
22+
"opts": {
23+
"template": "./node_modules/postman-jsdoc-theme",
24+
"encoding": "utf8",
25+
"destination": "./out/docs",
26+
"recurse": true,
27+
"readme": "README.md"
28+
},
29+
30+
"markdown": {
31+
"parser": "gfm",
32+
"hardwrap": false
33+
}
34+
}
35+

codegens/csharp-httpclient/.npmignore

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
### NPM Specific: Disregard recursive project files
2+
### ===============================================
3+
/.editorconfig
4+
/.gitmodules
5+
/test
6+
7+
### Borrowed from .gitignore
8+
### ========================
9+
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Prevent IDE stuff
24+
.idea
25+
.vscode
26+
*.sublime-*
27+
28+
# Directory for instrumented libs generated by jscoverage/JSCover
29+
lib-cov
30+
31+
# Coverage directory used by tools like istanbul
32+
.coverage
33+
34+
# nyc test coverage
35+
.nyc_output
36+
37+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38+
.grunt
39+
40+
# Bower dependency directory (https://bower.io/)
41+
bower_components
42+
43+
# node-waf configuration
44+
.lock-wscript
45+
46+
# Compiled binary addons (http://nodejs.org/api/addons.html)
47+
build/Release
48+
49+
# Dependency directories
50+
node_modules/
51+
jspm_packages/
52+
53+
# Typescript v1 declaration files
54+
typings/
55+
56+
# Optional npm cache directory
57+
.npm
58+
59+
# Optional eslint cache
60+
.eslintcache
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
74+
snippet.swift
75+
76+
out/

codegens/csharp-httpclient/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
> Converts Postman-SDK Request into code snippet for .
3+
4+
#### Prerequisites
5+
To run Code-Gen, ensure that you have NodeJS >= v8. A copy of the NodeJS installable can be downloaded from https://nodejs.org/en/download/package-manager.
6+
7+
## Using the Module
8+
The module will expose an object which will have property `convert` which is the function for converting the Postman-SDK request to swift code snippet.
9+
10+
### convert function
11+
Convert function takes three parameters
12+
13+
* `request` - Postman-SDK Request Object
14+
15+
* `options` - options is an object which hsa following properties
16+
* `indentType` - String denoting type of indentation for code snippet. eg: 'Space', 'Tab'
17+
* `indentCount` - The number of indentation characters to add per code level
18+
* `trimRequestBody` - Whether or not request body fields should be trimmed
19+
20+
* `callback` - callback function with first parameter as error and second parameter as string for code snippet
21+
22+
##### Example:
23+
```js
24+
var request = new sdk.Request('www.google.com'), //using postman sdk to create request
25+
options = {
26+
indentCount: 3,
27+
indentType: 'Space',
28+
requestTimeout: 200,
29+
trimRequestBody: true
30+
};
31+
convert(request, options, function(error, snippet) {
32+
if (error) {
33+
// handle error
34+
}
35+
// handle snippet
36+
});
37+
```
38+
### Guidelines for using generated snippet
39+
40+
* Since Postman-SDK Request object doesn't provide complete path of the file, it needs to be manually inserted in case of uploading a file.
41+
42+
* This module doesn't support cookies.

codegens/csharp-httpclient/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./lib');

0 commit comments

Comments
 (0)