-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java][Microprofile] Fix #17526: enumOuterClass missing JSON-B (de)se…
…rializer (#18951) * GH-17526/microprofile: Fix enumOuterClass missing JSON-B (de)serializer * Add microprofile-rest-client-outer-enum to jdk17 samples workflow * Regenerate samples
- Loading branch information
Showing
23 changed files
with
1,181 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
generatorName: java | ||
outputDir: samples/client/petstore/java/microprofile-rest-client-outer-enum | ||
library: microprofile | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/Java | ||
additionalProperties: | ||
artifactId: microprofile-rest-client | ||
configKeyFromClassName: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Petstore API | ||
description: API for managing pets in a pet store | ||
version: 1.0.0 | ||
paths: | ||
/dogs: | ||
get: | ||
summary: List all dogs | ||
operationId: listDogs | ||
responses: | ||
'200': | ||
description: A list of dogs | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Dog' | ||
/cats: | ||
get: | ||
summary: List all cats | ||
operationId: listCats | ||
responses: | ||
'200': | ||
description: A list of cats | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Cat' | ||
components: | ||
schemas: | ||
Dog: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
status: | ||
$ref: '#/components/schemas/Status' | ||
required: | ||
- id | ||
- name | ||
- status | ||
Cat: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
status: | ||
$ref: '#/components/schemas/Status' | ||
required: | ||
- id | ||
- name | ||
- status | ||
Status: | ||
type: string | ||
enum: | ||
- available | ||
- pending | ||
- sold |
23 changes: 23 additions & 0 deletions
23
samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
12 changes: 12 additions & 0 deletions
12
samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
README.md | ||
docs/Cat.md | ||
docs/DefaultApi.md | ||
docs/Dog.md | ||
docs/Status.md | ||
pom.xml | ||
src/main/java/org/openapitools/client/api/ApiException.java | ||
src/main/java/org/openapitools/client/api/ApiExceptionMapper.java | ||
src/main/java/org/openapitools/client/api/DefaultApi.java | ||
src/main/java/org/openapitools/client/model/Cat.java | ||
src/main/java/org/openapitools/client/model/Dog.java | ||
src/main/java/org/openapitools/client/model/Status.java |
1 change: 1 addition & 0 deletions
1
samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.8.0-SNAPSHOT |
9 changes: 9 additions & 0 deletions
9
samples/client/petstore/java/microprofile-rest-client-outer-enum/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Petstore API - MicroProfile Rest Client & MicroProfile Server | ||
|
||
API for managing pets in a pet store | ||
|
||
## Overview | ||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. | ||
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling | ||
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. | ||
|
15 changes: 15 additions & 0 deletions
15
samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Cat.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
# Cat | ||
|
||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
|------------ | ------------- | ------------- | -------------| | ||
|**id** | **Long** | | | | ||
|**name** | **String** | | | | ||
|**status** | **Status** | | | | ||
|
||
|
||
|
130 changes: 130 additions & 0 deletions
130
...les/client/petstore/java/microprofile-rest-client-outer-enum/docs/DefaultApi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# DefaultApi | ||
|
||
All URIs are relative to *http://localhost* | ||
|
||
| Method | HTTP request | Description | | ||
|------------- | ------------- | -------------| | ||
| [**listCats**](DefaultApi.md#listCats) | **GET** /cats | List all cats | | ||
| [**listDogs**](DefaultApi.md#listDogs) | **GET** /dogs | List all dogs | | ||
|
||
|
||
|
||
## listCats | ||
|
||
> List<Cat> listCats() | ||
List all cats | ||
|
||
### Example | ||
|
||
```java | ||
// Import classes: | ||
import org.openapitools.client.ApiClient; | ||
import org.openapitools.client.ApiException; | ||
import org.openapitools.client.Configuration; | ||
import org.openapitools.client.models.*; | ||
import org.openapitools.client.api.DefaultApi; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = Configuration.getDefaultApiClient(); | ||
defaultClient.setBasePath("http://localhost"); | ||
|
||
DefaultApi apiInstance = new DefaultApi(defaultClient); | ||
try { | ||
List<Cat> result = apiInstance.listCats(); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling DefaultApi#listCats"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Parameters | ||
|
||
This endpoint does not need any parameter. | ||
|
||
### Return type | ||
|
||
[**List<Cat>**](Cat.md) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
||
|
||
### HTTP response details | ||
| Status code | Description | Response headers | | ||
|-------------|-------------|------------------| | ||
| **200** | A list of cats | - | | ||
|
||
|
||
## listDogs | ||
|
||
> List<Dog> listDogs() | ||
List all dogs | ||
|
||
### Example | ||
|
||
```java | ||
// Import classes: | ||
import org.openapitools.client.ApiClient; | ||
import org.openapitools.client.ApiException; | ||
import org.openapitools.client.Configuration; | ||
import org.openapitools.client.models.*; | ||
import org.openapitools.client.api.DefaultApi; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = Configuration.getDefaultApiClient(); | ||
defaultClient.setBasePath("http://localhost"); | ||
|
||
DefaultApi apiInstance = new DefaultApi(defaultClient); | ||
try { | ||
List<Dog> result = apiInstance.listDogs(); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling DefaultApi#listDogs"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Parameters | ||
|
||
This endpoint does not need any parameter. | ||
|
||
### Return type | ||
|
||
[**List<Dog>**](Dog.md) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
||
|
||
### HTTP response details | ||
| Status code | Description | Response headers | | ||
|-------------|-------------|------------------| | ||
| **200** | A list of dogs | - | | ||
|
15 changes: 15 additions & 0 deletions
15
samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Dog.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
# Dog | ||
|
||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
|------------ | ------------- | ------------- | -------------| | ||
|**id** | **Long** | | | | ||
|**name** | **String** | | | | ||
|**status** | **Status** | | | | ||
|
||
|
||
|
15 changes: 15 additions & 0 deletions
15
samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Status.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
# Status | ||
|
||
## Enum | ||
|
||
|
||
* `AVAILABLE` (value: `"available"`) | ||
|
||
* `PENDING` (value: `"pending"`) | ||
|
||
* `SOLD` (value: `"sold"`) | ||
|
||
|
||
|
Oops, something went wrong.