Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,28 @@ paths:
type: integer
required:
- file
/test/json-header-content:
post:
tags:
- fake
operationId: test-json-header-content
parameters:
- name: X-Json-Arg
in: header
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/HeaderArg'
- name: X-Plain-Arg
in: header
required: false
schema:
type: string
responses:
'204':
description: No content

/import_test/return_datetime:
get:
tags:
Expand Down Expand Up @@ -2946,3 +2968,10 @@ components:
type: string
format: uuid
pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
HeaderArg:
type: object
properties:
path:
type: string
recursive:
type: boolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 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;

import java.io.IOException;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.Temporal;
import java.time.temporal.TemporalAccessor;
import java.util.function.BiFunction;
import java.util.function.Function;

import com.fasterxml.jackson.core.JsonParser;

Check failure on line 26 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.core does not exist
import com.fasterxml.jackson.databind.DeserializationContext;

Check failure on line 27 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.databind does not exist
import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature;

Check failure on line 28 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.datatype.jsr310 does not exist
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;

Check failure on line 29 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.datatype.jsr310.deser does not exist

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public class RFC3339InstantDeserializer<T extends Temporal> extends InstantDeserializer<T> {

Check failure on line 32 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

cannot find symbol
private static final long serialVersionUID = 1L;
private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
= JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault();

public static final RFC3339InstantDeserializer<Instant> INSTANT = new RFC3339InstantDeserializer<>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
Instant::from,
a -> Instant.ofEpochMilli( a.value ),
a -> Instant.ofEpochSecond( a.integer, a.fraction ),
null,
true, // yes, replace zero offset with Z
DEFAULT_NORMALIZE_ZONE_ID,
DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
);

public static final RFC3339InstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>(
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
OffsetDateTime::from,
a -> OffsetDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ),
a -> OffsetDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ),
(d, z) -> ( d.isEqual( OffsetDateTime.MIN ) || d.isEqual( OffsetDateTime.MAX ) ?
d :
d.withOffsetSameInstant( z.getRules().getOffset( d.toLocalDateTime() ) ) ),
true, // yes, replace zero offset with Z
DEFAULT_NORMALIZE_ZONE_ID,
DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
);

public static final RFC3339InstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new RFC3339InstantDeserializer<>(
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
ZonedDateTime::from,
a -> ZonedDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ),
a -> ZonedDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ),
ZonedDateTime::withZoneSameInstant,
false, // keep zero offset and Z separate since zones explicitly supported
DEFAULT_NORMALIZE_ZONE_ID,
DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
);

protected RFC3339InstantDeserializer(
Class<T> supportedType,
DateTimeFormatter formatter,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,

Check failure on line 77 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

cannot find symbol
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust,
boolean replaceZeroOffsetAsZ,
boolean normalizeZoneId,
boolean readNumericStringsAsTimestamp) {
super(
supportedType,
formatter,
parsedToValue,
fromMilliseconds,
fromNanoseconds,
adjust,
replaceZeroOffsetAsZ,
normalizeZoneId,
readNumericStringsAsTimestamp
);
}

@Override
protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException {
return super._fromString(p, ctxt, string0.replace( ' ', 'T' ));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 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;

import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;

import com.fasterxml.jackson.databind.module.SimpleModule;

Check failure on line 19 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.databind.module does not exist
import com.fasterxml.jackson.databind.Module.SetupContext;

Check failure on line 20 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

package com.fasterxml.jackson.databind.Module does not exist

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public class RFC3339JavaTimeModule extends SimpleModule {

Check failure on line 23 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

cannot find symbol
private static final long serialVersionUID = 1L;

public RFC3339JavaTimeModule() {
super("RFC3339JavaTimeModule");
}

@Override
public void setupModule(SetupContext context) {

Check failure on line 31 in samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java

View workflow job for this annotation

GitHub Actions / Build Java Client JDK17 (samples/client/petstore/java/rest-assured-jackson3)

cannot find symbol
super.setupModule(context);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: super.setupModule runs while this module has no deserializers, so Jackson never registers these handlers with the mapper. Add them before calling super.setupModule.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/client/petstore/java/rest-assured-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java, line 32:

<comment>`super.setupModule` runs while this module has no deserializers, so Jackson never registers these handlers with the mapper. Add them before calling `super.setupModule`.</comment>

<file context>
@@ -0,0 +1,39 @@
+
+   @Override
+   public void setupModule(SetupContext context) {
+       super.setupModule(context);
+
+       addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT);
</file context>


addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT);
addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME);
addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ docs/Foo.md
docs/FooGetDefaultResponse.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HeaderArg.md
docs/HealthCheckResult.md
docs/HuntingDog.md
docs/ImportTestDatetimeApi.md
Expand Down Expand Up @@ -191,6 +192,7 @@ petstore_api/models/foo.py
petstore_api/models/foo_get_default_response.py
petstore_api/models/format_test.py
petstore_api/models/has_only_read_only.py
petstore_api/models/header_arg.py
petstore_api/models/health_check_result.py
petstore_api/models/hunting_dog.py
petstore_api/models/info.py
Expand Down
2 changes: 2 additions & 0 deletions samples/openapi3/client/petstore/python-aiohttp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
*FakeApi* | [**test_json_header_content**](docs/FakeApi.md#test_json_header_content) | **POST** /test/json-header-content |
*FakeApi* | [**test_object_for_multipart_requests**](docs/FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests |
*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
Expand Down Expand Up @@ -228,6 +229,7 @@ Class | Method | HTTP request | Description
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
- [FormatTest](docs/FormatTest.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [HeaderArg](docs/HeaderArg.md)
- [HealthCheckResult](docs/HealthCheckResult.md)
- [HuntingDog](docs/HuntingDog.md)
- [Info](docs/Info.md)
Expand Down
64 changes: 64 additions & 0 deletions samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Method | HTTP request | Description
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
[**test_json_header_content**](FakeApi.md#test_json_header_content) | **POST** /test/json-header-content |
[**test_object_for_multipart_requests**](FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests |
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
Expand Down Expand Up @@ -2265,6 +2266,69 @@ 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)

# **test_json_header_content**
> test_json_header_content(x_json_arg, x_plain_arg=x_plain_arg)

### Example


```python
import petstore_api
from petstore_api.models.header_arg import HeaderArg
from petstore_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)


# Enter a context with an instance of the API client
async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
x_json_arg = petstore_api.HeaderArg() # HeaderArg |
x_plain_arg = 'x_plain_arg_example' # str | (optional)

try:
await api_instance.test_json_header_content(x_json_arg, x_plain_arg=x_plain_arg)
except Exception as e:
print("Exception when calling FakeApi->test_json_header_content: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**x_json_arg** | [**HeaderArg**](.md)| |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The HeaderArg link resolves to .md instead of the generated model page. Change the target to HeaderArg.md so users can open the parameter type documentation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md, line 2308:

<comment>The `HeaderArg` link resolves to `.md` instead of the generated model page. Change the target to `HeaderArg.md` so users can open the parameter type documentation.</comment>

<file context>
@@ -2265,6 +2266,69 @@ No authorization required
+
+Name | Type | Description  | Notes
+------------- | ------------- | ------------- | -------------
+ **x_json_arg** | [**HeaderArg**](.md)|  | 
+ **x_plain_arg** | **str**|  | [optional] 
+
</file context>
Suggested change
**x_json_arg** | [**HeaderArg**](.md)| |
**x_json_arg** | [**HeaderArg**](HeaderArg.md)| |

**x_plain_arg** | **str**| | [optional]

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No content | - |

[[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)

# **test_object_for_multipart_requests**
> test_object_for_multipart_requests(marker)

Expand Down
30 changes: 30 additions & 0 deletions samples/openapi3/client/petstore/python-aiohttp/docs/HeaderArg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# HeaderArg


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**path** | **str** | | [optional]
**recursive** | **bool** | | [optional]

## Example

```python
from petstore_api.models.header_arg import HeaderArg

# TODO update the JSON string below
json = "{}"
# create an instance of HeaderArg from a JSON string
header_arg_instance = HeaderArg.from_json(json)
# print the JSON string representation of the object
print(HeaderArg.to_json())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The example calls to_json on the class, but it is an instance method and raises TypeError; serialize header_arg_instance instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/openapi3/client/petstore/python-aiohttp/docs/HeaderArg.md, line 21:

<comment>The example calls `to_json` on the class, but it is an instance method and raises `TypeError`; serialize `header_arg_instance` instead.</comment>

<file context>
@@ -0,0 +1,30 @@
+# create an instance of HeaderArg from a JSON string
+header_arg_instance = HeaderArg.from_json(json)
+# print the JSON string representation of the object
+print(HeaderArg.to_json())
+
+# convert the object into a dict
</file context>
Suggested change
print(HeaderArg.to_json())
print(header_arg_instance.to_json())


# convert the object into a dict
header_arg_dict = header_arg_instance.to_dict()
# create an instance of HeaderArg from a dict
header_arg_from_dict = HeaderArg.from_dict(header_arg_dict)
```
[[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
Expand Up @@ -86,6 +86,7 @@
"FooGetDefaultResponse",
"FormatTest",
"HasOnlyReadOnly",
"HeaderArg",
"HealthCheckResult",
"HuntingDog",
"Info",
Expand Down Expand Up @@ -225,6 +226,7 @@
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse
from petstore_api.models.format_test import FormatTest as FormatTest
from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly
from petstore_api.models.header_arg import HeaderArg as HeaderArg
from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult
from petstore_api.models.hunting_dog import HuntingDog as HuntingDog
from petstore_api.models.info import Info as Info
Expand Down
Loading
Loading