Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ public void processOpts() {
}
additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException());

typeMapping.put("file", "Resource");
importMapping.put("Resource", "org.springframework.core.io.Resource");
typeMapping.put("file", "org.springframework.core.io.Resource");
importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource");

if (useOptional) {
writePropertyBack(USE_OPTIONAL, useOptional);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,30 @@ paths:
- petstore_auth:
- 'write:pets'
- 'read:pets'
/fake/fileResponseTest:
get:
tags:
- fake
operationId: fileResponseTest
produces:
- "application/octet-stream"
responses:
200:
description: "OutputFileData"
schema:
type: file
/fake/resource-named-resource-test:
get:
tags:
- fake
operationId: resourceNamedResourceTest
produces:
- 'application/json'
responses:
200:
description: "Resource data"
schema:
$ref: "#/definitions/Resource"
securityDefinitions:
petstore_auth:
type: oauth2
Expand Down Expand Up @@ -2001,3 +2025,10 @@ definitions:
xml:
namespace: http://g.com/schema
prefix: g
Resource:
type: object
description: 'Must be named `Resource` for test.'
properties:
sourceURI:
description: 'Test resource'
type: string
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,18 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HealthCheckResult'
/fake/resource-named-resource-test:
get:
tags:
- fake
operationId: resourceNamedResourceTest
responses:
200:
description: Resource data
content:
application/json:
schema:
$ref: '#/components/schemas/Resource'
servers:
- url: 'http://{server}.swagger.io:{port}/v2'
description: petstore server
Expand Down Expand Up @@ -1764,3 +1776,10 @@ components:
additionalProperties:
type: object
nullable: true
Resource:
type: object
properties:
sourceURI:
type: string
description: Test resource
description: Must be named `Resource` for test.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ Class | Method | HTTP request | Description
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**FileResponseTest**](docs/FakeApi.md#fileresponsetest) | **GET** /fake/fileResponseTest |
*FakeApi* | [**ResourceNamedResourceTest**](docs/FakeApi.md#resourcenamedresourcetest) | **GET** /fake/resource-named-resource-test |
*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
Expand Down Expand Up @@ -174,6 +176,7 @@ Class | Method | HTTP request | Description
- [Model.OuterEnum](docs/OuterEnum.md)
- [Model.Pet](docs/Pet.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Resource](docs/Resource.md)
- [Model.Return](docs/Return.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
Expand Down
128 changes: 128 additions & 0 deletions samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Method | HTTP request | Description
[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**FileResponseTest**](FakeApi.md#fileresponsetest) | **GET** /fake/fileResponseTest |
[**ResourceNamedResourceTest**](FakeApi.md#resourcenamedresourcetest) | **GET** /fake/resource-named-resource-test |
[**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
Expand Down Expand Up @@ -365,6 +367,132 @@ No authorization required

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a name="fileresponsetest"></a>
# **FileResponseTest**
> System.IO.Stream FileResponseTest ()



### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
public class FileResponseTestExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);

try
{
System.IO.Stream result = apiInstance.FileResponseTest();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FakeApi.FileResponseTest: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

**System.IO.Stream**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/octet-stream

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OutputFileData | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a name="resourcenamedresourcetest"></a>
# **ResourceNamedResourceTest**
> Resource ResourceNamedResourceTest ()



### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
public class ResourceNamedResourceTestExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);

try
{
Resource result = apiInstance.ResourceNamedResourceTest();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FakeApi.ResourceNamedResourceTest: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**Resource**](Resource.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Resource data | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a name="testbodywithfileschema"></a>
# **TestBodyWithFileSchema**
> void TestBodyWithFileSchema (FileSchemaTestClass body)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.Resource
Must be named `Resource` for test.
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SourceURI** | **string** | Test resource | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using Xunit;

using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;

namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing Resource
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class ResourceTests : IDisposable
{
// TODO uncomment below to declare an instance variable for Resource
//private Resource instance;

public ResourceTests()
{
// TODO uncomment below to create an instance of Resource
//instance = new Resource();
}

public void Dispose()
{
// Cleanup when everything is done.
}

/// <summary>
/// Test an instance of Resource
/// </summary>
[Fact]
public void ResourceInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Resource
//Assert.IsInstanceOfType<Resource> (instance, "variable 'instance' is a Resource");
}


/// <summary>
/// Test the property 'SourceURI'
/// </summary>
[Fact]
public void SourceURITest()
{
// TODO unit test for the property 'SourceURI'
}

}

}
Loading