Skip to content

Commit 136974f

Browse files
committed
Update samples
1 parent aed0c50 commit 136974f

37 files changed

+3104
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
#
4+
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
5+
6+
name: Java CI with Maven
7+
8+
on:
9+
push:
10+
branches: [ main, master ]
11+
pull_request:
12+
branches: [ main, master ]
13+
14+
jobs:
15+
build:
16+
name: Build Minimal
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
java: [ 17, 21 ]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up JDK
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: 'temurin'
28+
cache: maven
29+
- name: Build with Maven
30+
run: mvn -B package --no-transfer-progress --file pom.xml
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# exclude jar for gradle wrapper
12+
!gradle/wrapper/*.jar
13+
14+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15+
hs_err_pid*
16+
17+
# build files
18+
**/target
19+
target
20+
.gradle
21+
build
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.github/workflows/maven.yml
2+
.gitignore
3+
.openapi-generator-ignore
4+
.travis.yml
5+
README.md
6+
api/openapi.yaml
7+
build.gradle
8+
build.sbt
9+
docs/FileApi.md
10+
docs/StructuredType.md
11+
git_push.sh
12+
gradle.properties
13+
gradle/wrapper/gradle-wrapper.jar
14+
gradle/wrapper/gradle-wrapper.properties
15+
gradlew
16+
gradlew.bat
17+
pom.xml
18+
settings.gradle
19+
src/main/AndroidManifest.xml
20+
src/main/java/org/openapitools/client/ApiClient.java
21+
src/main/java/org/openapitools/client/BaseApi.java
22+
src/main/java/org/openapitools/client/JavaTimeFormatter.java
23+
src/main/java/org/openapitools/client/RFC3339DateFormat.java
24+
src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java
25+
src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java
26+
src/main/java/org/openapitools/client/ServerConfiguration.java
27+
src/main/java/org/openapitools/client/ServerVariable.java
28+
src/main/java/org/openapitools/client/api/FileApi.java
29+
src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
30+
src/main/java/org/openapitools/client/auth/Authentication.java
31+
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
32+
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
33+
src/main/java/org/openapitools/client/model/StructuredType.java
34+
src/test/java/org/openapitools/client/api/FileApiTest.java
35+
src/test/java/org/openapitools/client/model/StructuredTypeTest.java
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.19.0-SNAPSHOT
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Generated by OpenAPI Generator: https://openapi-generator.tech
3+
#
4+
# Ref: https://docs.travis-ci.com/user/languages/java/
5+
#
6+
language: java
7+
jdk:
8+
- openjdk12
9+
- openjdk11
10+
- openjdk10
11+
- openjdk9
12+
- openjdk8
13+
before_install:
14+
# ensure gradlew has proper permission
15+
- chmod a+x ./gradlew
16+
script:
17+
# test using maven
18+
#- mvn test
19+
# test using gradle
20+
- gradle test
21+
# test using sbt
22+
# - sbt test
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# additonal-properties-in-multipart-request-issue
2+
3+
Minimal
4+
5+
- API version: 0.5.1-SNAPSHOT.0
6+
7+
- Generator version: 7.19.0-SNAPSHOT
8+
9+
Api to reproduce bug
10+
11+
12+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
13+
14+
## Requirements
15+
16+
Building the API client library requires:
17+
18+
1. Java 1.8+
19+
2. Maven/Gradle
20+
21+
## Installation
22+
23+
To install the API client library to your local Maven repository, simply execute:
24+
25+
```shell
26+
mvn clean install
27+
```
28+
29+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
30+
31+
```shell
32+
mvn clean deploy
33+
```
34+
35+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
36+
37+
### Maven users
38+
39+
Add this dependency to your project's POM:
40+
41+
```xml
42+
<dependency>
43+
<groupId>org.openapitools</groupId>
44+
<artifactId>additonal-properties-in-multipart-request-issue</artifactId>
45+
<version>0.5.1-SNAPSHOT.0</version>
46+
<scope>compile</scope>
47+
</dependency>
48+
```
49+
50+
### Gradle users
51+
52+
Add this dependency to your project's build file:
53+
54+
```groovy
55+
repositories {
56+
mavenCentral() // Needed if the 'additonal-properties-in-multipart-request-issue' jar has been published to maven central.
57+
mavenLocal() // Needed if the 'additonal-properties-in-multipart-request-issue' jar has been published to the local maven repo.
58+
}
59+
60+
dependencies {
61+
implementation "org.openapitools:additonal-properties-in-multipart-request-issue:0.5.1-SNAPSHOT.0"
62+
}
63+
```
64+
65+
### Others
66+
67+
At first generate the JAR by executing:
68+
69+
```shell
70+
mvn clean package
71+
```
72+
73+
Then manually install the following JARs:
74+
75+
- `target/additonal-properties-in-multipart-request-issue-0.5.1-SNAPSHOT.0.jar`
76+
- `target/lib/*.jar`
77+
78+
## Getting Started
79+
80+
Please follow the [installation](#installation) instruction and execute the following Java code:
81+
82+
```java
83+
84+
import org.openapitools.client.*;
85+
import org.openapitools.client.auth.*;
86+
import org.openapitools.client.model.*;
87+
import org.openapitools.client.api.FileApi;
88+
89+
public class FileApiExample {
90+
91+
public static void main(String[] args) {
92+
ApiClient defaultClient = Configuration.getDefaultApiClient();
93+
defaultClient.setBasePath("http://localhost:8080");
94+
95+
FileApi apiInstance = new FileApi(defaultClient);
96+
File documentBytes = new File("/path/to/file"); // File |
97+
String documentType = "documentType_example"; // String |
98+
Map<String, String> properties = new HashMap(); // Map<String, String> |
99+
StructuredType structured = new StructuredType(); // StructuredType |
100+
try {
101+
apiInstance.createFile(documentBytes, documentType, properties, structured);
102+
} catch (ApiException e) {
103+
System.err.println("Exception when calling FileApi#createFile");
104+
System.err.println("Status code: " + e.getCode());
105+
System.err.println("Reason: " + e.getResponseBody());
106+
System.err.println("Response headers: " + e.getResponseHeaders());
107+
e.printStackTrace();
108+
}
109+
}
110+
}
111+
112+
```
113+
114+
## Documentation for API Endpoints
115+
116+
All URIs are relative to *http://localhost:8080*
117+
118+
Class | Method | HTTP request | Description
119+
------------ | ------------- | ------------- | -------------
120+
*FileApi* | [**createFile**](docs/FileApi.md#createFile) | **POST** /api/v1/file |
121+
122+
123+
## Documentation for Models
124+
125+
- [StructuredType](docs/StructuredType.md)
126+
127+
128+
<a id="documentation-for-authorization"></a>
129+
## Documentation for Authorization
130+
131+
Endpoints do not require authorization.
132+
133+
134+
## Recommendation
135+
136+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
137+
138+
## Author
139+
140+
141+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
openapi: 3.0.3
2+
info:
3+
description: Api to reproduce bug
4+
title: Minimal
5+
version: 0.5.1-SNAPSHOT.0
6+
servers:
7+
- url: http://localhost:8080
8+
tags:
9+
- name: test
10+
paths:
11+
/api/v1/file:
12+
post:
13+
operationId: createFile
14+
requestBody:
15+
content:
16+
multipart/form-data:
17+
encoding:
18+
documentBytes:
19+
contentType: '*/*'
20+
style: form
21+
properties:
22+
contentType: application/json
23+
style: form
24+
schema:
25+
$ref: "#/components/schemas/FileUploadRequest"
26+
required: true
27+
responses:
28+
"201":
29+
description: File created successfully
30+
tags:
31+
- file
32+
x-content-type: multipart/form-data
33+
x-accepts:
34+
- application/json
35+
components:
36+
schemas:
37+
FileUploadRequest:
38+
properties:
39+
documentBytes:
40+
format: binary
41+
type: string
42+
documentType:
43+
type: string
44+
structured:
45+
$ref: "#/components/schemas/StructuredType"
46+
properties:
47+
$ref: "#/components/schemas/TypeMap"
48+
required:
49+
- documentBytes
50+
- documentType
51+
- properties
52+
type: object
53+
TypeMap:
54+
additionalProperties:
55+
type: string
56+
type: object
57+
StructuredType:
58+
properties:
59+
someString:
60+
type: string
61+
type: object
62+

0 commit comments

Comments
 (0)