Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !478
An error occurred while fetching the assigned milestone of the selected merge_request.

Update petstore samples to fix Shippable CI failure

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged William Cheng requested to merge fix_shippable1 into master 7 years ago
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 5

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.1.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Update the samples/ to fix Shippable CI

Compare
  • master (base)

and
  • latest version
    32261271
    1 commit, 2 years ago

5 files
+ 216
- 2

    Preferences

    File browser
    Compare changes
sam‎ples‎
client/petstore‎/java/webclient‎
do‎cs‎
FakeA‎pi.md‎ +45 -0
FileSchemaT‎estClass.md‎ +11 -0
src/main/java/org/‎openapitools/client‎
a‎pi‎
FakeAp‎i.java‎ +34 -0
mo‎del‎
FileSchemaTe‎stClass.java‎ +124 -0
openapi3/client/pe‎tstore/…/…/lib/Api‎
PetAp‎i.php‎ +2 -2
samples/client/petstore/java/webclient/docs/FakeApi.md
+ 45
- 0
  • View file @ 32261271

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,6 +8,7 @@ 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 |
[**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
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -196,6 +197,50 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: */*
<a name="testBodyWithFileSchema"></a>
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
### Example
```java
// Import classes:
//import org.openapitools.client.ApiException;
//import org.openapitools.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
try {
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testBodyWithQueryParams"></a>
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, user)
samples/client/petstore/java/webclient/docs/FileSchemaTestClass.md 0 → 100644
+ 11
- 0
  • View file @ 32261271

  • Edit in single-file editor

  • Open in Web IDE

# FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**java.io.File**](java.io.File.md) | | [optional]
**files** | [**List&lt;java.io.File&gt;**](java.io.File.md) | | [optional]
samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java
+ 34
- 0
  • View file @ 32261271

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import java.io.File;
import org.openapitools.client.model.FileSchemaTestClass;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import org.openapitools.client.model.OuterComposite;
@@ -167,6 +168,39 @@ public class FakeApi {
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* <p><b>200</b> - Success
* @param fileSchemaTestClass The fileSchemaTestClass parameter
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws RestClientException {
Object postBody = fileSchemaTestClass;
// verify the required parameter 'fileSchemaTestClass' is set
if (fileSchemaTestClass == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
}
String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] accepts = { };
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
*
samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java 0 → 100644
+ 124
- 0
  • View file @ 32261271

  • Edit in single-file editor

  • Open in Web IDE

/*
* 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: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* FileSchemaTestClass
*/
public class FileSchemaTestClass {
@JsonProperty("file")
private java.io.File file = null;
@JsonProperty("files")
private List<java.io.File> files = null;
public FileSchemaTestClass file(java.io.File file) {
this.file = file;
return this;
}
/**
* Get file
* @return file
**/
@ApiModelProperty(value = "")
public java.io.File getFile() {
return file;
}
public void setFile(java.io.File file) {
this.file = file;
}
public FileSchemaTestClass files(List<java.io.File> files) {
this.files = files;
return this;
}
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
if (this.files == null) {
this.files = new ArrayList<>();
}
this.files.add(filesItem);
return this;
}
/**
* Get files
* @return files
**/
@ApiModelProperty(value = "")
public List<java.io.File> getFiles() {
return files;
}
public void setFiles(List<java.io.File> files) {
this.files = files;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
return Objects.equals(this.file, fileSchemaTestClass.file) &&
Objects.equals(this.files, fileSchemaTestClass.files);
}
@Override
public int hashCode() {
return Objects.hash(file, files);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FileSchemaTestClass {\n");
sb.append(" file: ").append(toIndentedString(file)).append("\n");
sb.append(" files: ").append(toIndentedString(files)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php
+ 2
- 2
  • View file @ 32261271

  • Edit in single-file editor

  • Open in Web IDE


@@ -756,7 +756,7 @@ class PetApi
// query params
if (is_array($status)) {
$status = ObjectSerializer::serializeCollection($status, 'multi', true);
$status = ObjectSerializer::serializeCollection($status, 'csv', true);
}
if ($status !== null) {
$queryParams['status'] = ObjectSerializer::toQueryValue($status);
@@ -1040,7 +1040,7 @@ class PetApi
// query params
if (is_array($tags)) {
$tags = ObjectSerializer::serializeCollection($tags, 'multi', true);
$tags = ObjectSerializer::serializeCollection($tags, 'csv', true);
}
if ($tags !== null) {
$queryParams['tags'] = ObjectSerializer::toQueryValue($tags);
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: fix_shippable1

Menu

Explore Projects Groups Snippets