Skip to content

Commit 4195324

Browse files
committed
Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator into use-java8-offsetdatetime-for-clients
2 parents 5c4338d + ae6abfc commit 4195324

File tree

152 files changed

+523
-767
lines changed

Some content is hidden

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

152 files changed

+523
-767
lines changed

modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using RestSharpMethod = RestSharp.Method;
2727
namespace {{packageName}}.Client
2828
{
2929
/// <summary>
30-
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
30+
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
3131
/// </summary>
3232
internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer
3333
{
@@ -241,7 +241,7 @@ namespace {{packageName}}.Client
241241
if (path == null) throw new ArgumentNullException("path");
242242
if (options == null) throw new ArgumentNullException("options");
243243
if (configuration == null) throw new ArgumentNullException("configuration");
244-
244+
245245
RestRequest request = new RestRequest(Method(method))
246246
{
247247
Resource = path,
@@ -255,7 +255,7 @@ namespace {{packageName}}.Client
255255
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
256256
}
257257
}
258-
258+
259259
if (options.QueryParameters != null)
260260
{
261261
foreach (var queryParam in options.QueryParameters)
@@ -337,7 +337,7 @@ namespace {{packageName}}.Client
337337
request.AddCookie(cookie.Name, cookie.Value);
338338
}
339339
}
340-
340+
341341
return request;
342342
}
343343
@@ -351,7 +351,7 @@ namespace {{packageName}}.Client
351351
ErrorText = response.ErrorMessage,
352352
Cookies = new List<Cookie>()
353353
};
354-
354+
355355
if (response.Headers != null)
356356
{
357357
foreach (var responseHeader in response.Headers)
@@ -366,9 +366,9 @@ namespace {{packageName}}.Client
366366
{
367367
transformed.Cookies.Add(
368368
new Cookie(
369-
responseCookies.Name,
370-
responseCookies.Value,
371-
responseCookies.Path,
369+
responseCookies.Name,
370+
responseCookies.Value,
371+
responseCookies.Path,
372372
responseCookies.Domain)
373373
);
374374
}

modules/openapi-generator/src/main/resources/csharp-netcore/ApiResponse.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace {{packageName}}.Client
5555
public class ApiResponse<T> : IApiResponse
5656
{
5757
#region Properties
58-
58+
5959
/// <summary>
6060
/// Gets or sets the status code (HTTP status code)
6161
/// </summary>
@@ -104,11 +104,11 @@ namespace {{packageName}}.Client
104104
/// The raw content
105105
/// </summary>
106106
public string RawContent { get;}
107-
107+
108108
#endregion Properties
109-
109+
110110
#region Constructors
111-
111+
112112
/// <summary>
113113
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
114114
/// </summary>

modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace {{packageName}}.Client
4545
}
4646

4747
/// <summary>
48-
/// Convert params to key/value pairs.
48+
/// Convert params to key/value pairs.
4949
/// Use collectionFormat to properly format lists and collections.
5050
/// </summary>
5151
/// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param>
@@ -70,7 +70,7 @@ namespace {{packageName}}.Client
7070

7171
return parameters;
7272
}
73-
73+
7474
/// <summary>
7575
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
7676
/// If parameter is a list, join the list with ",".

modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ namespace {{packageName}}.Client
212212
{
213213
return apiKeyPrefix + " " + apiKeyValue;
214214
}
215-
215+
216216
return apiKeyValue;
217217
}
218218

@@ -224,7 +224,7 @@ namespace {{packageName}}.Client
224224

225225
/// <summary>
226226
/// Gets or sets the access token for OAuth2 authentication.
227-
///
227+
///
228228
/// This helper property simplifies code generation.
229229
/// </summary>
230230
/// <value>The access token.</value>
@@ -294,13 +294,13 @@ namespace {{packageName}}.Client
294294
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
295295
///
296296
/// Whatever you set here will be prepended to the value defined in AddApiKey.
297-
///
297+
///
298298
/// An example invocation here might be:
299299
/// <example>
300300
/// ApiKeyPrefix["Authorization"] = "Bearer";
301301
/// </example>
302302
/// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
303-
///
303+
///
304304
/// <remarks>
305305
/// OAuth2 workflows should set tokens via AccessToken.
306306
/// </remarks>
@@ -394,11 +394,11 @@ namespace {{packageName}}.Client
394394
public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)
395395
{
396396
if (second == null) return first ?? GlobalConfiguration.Instance;
397-
397+
398398
Dictionary<string, string> apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
399399
Dictionary<string, string> apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
400400
Dictionary<string, string> defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
401-
401+
402402
foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value;
403403
foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value;
404404
foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value;

modules/openapi-generator/src/main/resources/csharp-netcore/IApiAccessor.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace {{packageName}}.Client
2020
/// </summary>
2121
/// <value>The base path</value>
2222
String GetBasePath();
23-
23+
2424
/// <summary>
2525
/// Provides a factory method hook for the creation of exceptions.
2626
/// </summary>

modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace {{packageName}}.Client
88
{
99
/// <summary>
1010
/// Contract for Asynchronous RESTful API interactions.
11-
///
11+
///
1212
/// This interface allows consumers to provide a custom API accessor client.
1313
/// </summary>
1414
public interface IAsynchronousClient
@@ -23,7 +23,7 @@ namespace {{packageName}}.Client
2323
/// <typeparam name="T">The return type.</typeparam>
2424
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
2525
Task<ApiResponse<T>> GetAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
26-
26+
2727
/// <summary>
2828
/// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb.
2929
/// </summary>
@@ -34,7 +34,7 @@ namespace {{packageName}}.Client
3434
/// <typeparam name="T">The return type.</typeparam>
3535
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
3636
Task<ApiResponse<T>> PostAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
37-
37+
3838
/// <summary>
3939
/// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb.
4040
/// </summary>
@@ -45,7 +45,7 @@ namespace {{packageName}}.Client
4545
/// <typeparam name="T">The return type.</typeparam>
4646
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
4747
Task<ApiResponse<T>> PutAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
48-
48+
4949
/// <summary>
5050
/// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb.
5151
/// </summary>
@@ -56,7 +56,7 @@ namespace {{packageName}}.Client
5656
/// <typeparam name="T">The return type.</typeparam>
5757
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
5858
Task<ApiResponse<T>> DeleteAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
59-
59+
6060
/// <summary>
6161
/// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb.
6262
/// </summary>
@@ -67,7 +67,7 @@ namespace {{packageName}}.Client
6767
/// <typeparam name="T">The return type.</typeparam>
6868
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
6969
Task<ApiResponse<T>> HeadAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
70-
70+
7171
/// <summary>
7272
/// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb.
7373
/// </summary>
@@ -78,7 +78,7 @@ namespace {{packageName}}.Client
7878
/// <typeparam name="T">The return type.</typeparam>
7979
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
8080
Task<ApiResponse<T>> OptionsAsync<T>(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
81-
81+
8282
/// <summary>
8383
/// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb.
8484
/// </summary>

modules/openapi-generator/src/main/resources/csharp-netcore/ISynchronousClient.mustache

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace {{packageName}}.Client
77
{
88
/// <summary>
99
/// Contract for Synchronous RESTful API interactions.
10-
///
10+
///
1111
/// This interface allows consumers to provide a custom API accessor client.
1212
/// </summary>
1313
public interface ISynchronousClient
@@ -21,7 +21,7 @@ namespace {{packageName}}.Client
2121
/// <typeparam name="T">The return type.</typeparam>
2222
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
2323
ApiResponse<T> Get<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
24-
24+
2525
/// <summary>
2626
/// Executes a blocking call to some <paramref name="path"/> using the POST http verb.
2727
/// </summary>
@@ -31,7 +31,7 @@ namespace {{packageName}}.Client
3131
/// <typeparam name="T">The return type.</typeparam>
3232
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
3333
ApiResponse<T> Post<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
34-
34+
3535
/// <summary>
3636
/// Executes a blocking call to some <paramref name="path"/> using the PUT http verb.
3737
/// </summary>
@@ -41,7 +41,7 @@ namespace {{packageName}}.Client
4141
/// <typeparam name="T">The return type.</typeparam>
4242
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
4343
ApiResponse<T> Put<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
44-
44+
4545
/// <summary>
4646
/// Executes a blocking call to some <paramref name="path"/> using the DELETE http verb.
4747
/// </summary>
@@ -51,7 +51,7 @@ namespace {{packageName}}.Client
5151
/// <typeparam name="T">The return type.</typeparam>
5252
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
5353
ApiResponse<T> Delete<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
54-
54+
5555
/// <summary>
5656
/// Executes a blocking call to some <paramref name="path"/> using the HEAD http verb.
5757
/// </summary>
@@ -61,7 +61,7 @@ namespace {{packageName}}.Client
6161
/// <typeparam name="T">The return type.</typeparam>
6262
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
6363
ApiResponse<T> Head<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
64-
64+
6565
/// <summary>
6666
/// Executes a blocking call to some <paramref name="path"/> using the OPTIONS http verb.
6767
/// </summary>
@@ -71,7 +71,7 @@ namespace {{packageName}}.Client
7171
/// <typeparam name="T">The return type.</typeparam>
7272
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
7373
ApiResponse<T> Options<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
74-
74+
7575
/// <summary>
7676
/// Executes a blocking call to some <paramref name="path"/> using the PATCH http verb.
7777
/// </summary>
@@ -82,4 +82,4 @@ namespace {{packageName}}.Client
8282
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
8383
ApiResponse<T> Patch<T>(String path, RequestOptions options, IReadableConfiguration configuration = null);
8484
}
85-
}
85+
}

modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ namespace {{packageName}}.{{apiPackage}}
2424
/// <summary>
2525
/// {{summary}}
2626
/// </summary>
27+
{{#notes}}
2728
/// <remarks>
2829
/// {{notes}}
2930
/// </remarks>
31+
{{/notes}}
3032
/// <exception cref="{{packageName}}.Client.ApiException">Thrown when fails to make API call</exception>
3133
{{#allParams}}/// <param name="{{paramName}}">{{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}</param>
3234
{{/allParams}}/// <returns>{{#returnType}}{{returnType}}{{/returnType}}</returns>
@@ -244,7 +246,7 @@ namespace {{packageName}}.{{apiPackage}}
244246

245247
String[] _contentTypes = new String[] {
246248
{{#consumes}}
247-
"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}
249+
"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}
248250
{{/consumes}}
249251
};
250252

@@ -436,7 +438,7 @@ namespace {{packageName}}.{{apiPackage}}
436438

437439
var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts);
438440
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
439-
441+
440442
{{#pathParams}}
441443
{{#required}}
442444
localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter

modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
{{/isInherited}}
9494
{{/vars}}
9595
}
96-
96+
9797
{{#vars}}
9898
{{^isInherited}}
9999
{{^isEnum}}
@@ -125,7 +125,7 @@
125125
sb.Append("}\n");
126126
return sb.ToString();
127127
}
128-
128+
129129
/// <summary>
130130
/// Returns the JSON string presentation of the object
131131
/// </summary>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
{{#appName}}
33
* {{{appName}}}
44
*
@@ -7,7 +7,11 @@
77
* {{{appDescription}}}
88
*
99
{{/appDescription}}
10-
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
11-
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
10+
{{#version}}
11+
* The version of the OpenAPI document: {{{version}}}
12+
{{/version}}
13+
{{#infoEmail}}
14+
* Contact: {{{infoEmail}}}
15+
{{/infoEmail}}
1216
* Generated by: https://github.com/openapitools/openapi-generator.git
1317
*/

0 commit comments

Comments
 (0)