From 3566bd1252b8c5e8ecacb7d39cf57ffac759aec7 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Dec 2024 10:09:51 -0500 Subject: [PATCH 1/6] feat(java): Respect content-type header from IR v53 --- .../endpoint/AbstractEndpointWriter.java | 32 +++++++++++++++++++ .../endpoint/NoRequestEndpointWriter.java | 11 ++----- .../endpoint/OnlyRequestEndpointWriter.java | 11 ++----- .../WrappedRequestEndpointWriter.java | 12 ++----- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/AbstractEndpointWriter.java b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/AbstractEndpointWriter.java index f2d886660ce..3ff1e9b5ce3 100644 --- a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/AbstractEndpointWriter.java +++ b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/AbstractEndpointWriter.java @@ -200,10 +200,41 @@ public final HttpEndpointMethodSpecs generate() { boolean sendContentType = httpEndpoint.getRequestBody().isPresent() || (httpEndpoint.getResponse().isPresent() && httpEndpoint.getResponse().get().getBody().isPresent()); + String contentType = httpEndpoint + .getRequestBody() + .flatMap(body -> body.visit(new HttpRequestBody.Visitor>() { + @Override + public Optional visitInlinedRequestBody(InlinedRequestBody inlinedRequestBody) { + return inlinedRequestBody.getContentType(); + } + + @Override + public Optional visitReference(HttpRequestBodyReference httpRequestBodyReference) { + return httpRequestBodyReference.getContentType(); + } + + @Override + public Optional visitFileUpload(FileUploadRequest fileUploadRequest) { + // N.B. File upload headers are obtained from request configuration. + return Optional.empty(); + } + + @Override + public Optional visitBytes(BytesRequest bytesRequest) { + return bytesRequest.getContentType(); + } + + @Override + public Optional _visitUnknown(Object o) { + throw new IllegalArgumentException("Unknown request type."); + } + })) + .orElse(AbstractEndpointWriter.APPLICATION_JSON_HEADER); CodeBlock requestInitializer = getInitializeRequestCodeBlock( clientOptionsField, generatedClientOptions, httpEndpoint, + contentType, generatedObjectMapper, generatedHttpUrl.inlinableBuild(), sendContentType); @@ -334,6 +365,7 @@ public abstract CodeBlock getInitializeRequestCodeBlock( FieldSpec clientOptionsMember, GeneratedClientOptions clientOptions, HttpEndpoint endpoint, + String contentType, GeneratedObjectMapper objectMapper, CodeBlock inlineableHttpUrl, boolean sendContentType); diff --git a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/NoRequestEndpointWriter.java b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/NoRequestEndpointWriter.java index 204d6489dc5..2508645bffe 100644 --- a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/NoRequestEndpointWriter.java +++ b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/NoRequestEndpointWriter.java @@ -17,10 +17,7 @@ package com.fern.java.client.generators.endpoint; import com.fern.ir.model.commons.ErrorId; -import com.fern.ir.model.http.HttpEndpoint; -import com.fern.ir.model.http.HttpMethod; -import com.fern.ir.model.http.HttpService; -import com.fern.ir.model.http.SdkRequest; +import com.fern.ir.model.http.*; import com.fern.java.client.ClientGeneratorContext; import com.fern.java.client.GeneratedClientOptions; import com.fern.java.client.GeneratedEnvironmentsClass; @@ -86,6 +83,7 @@ public CodeBlock getInitializeRequestCodeBlock( FieldSpec clientOptionsMember, GeneratedClientOptions clientOptions, HttpEndpoint httpEndpoint, + String contentType, GeneratedObjectMapper generatedObjectMapper, CodeBlock inlineableHttpUrl, boolean sendContentType) { @@ -111,10 +109,7 @@ public CodeBlock getInitializeRequestCodeBlock( ClientOptionsGenerator.HEADERS_METHOD_NAME, REQUEST_OPTIONS_PARAMETER_NAME); if (sendContentType) { - builder.add( - ".addHeader($S, $S)\n", - AbstractEndpointWriter.CONTENT_TYPE_HEADER, - AbstractEndpointWriter.APPLICATION_JSON_HEADER); + builder.add(".addHeader($S, $S)\n", AbstractEndpointWriter.CONTENT_TYPE_HEADER, contentType); } return builder.add(".build();\n").unindent().build(); } diff --git a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/OnlyRequestEndpointWriter.java b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/OnlyRequestEndpointWriter.java index 5434d9c69eb..bf4c57d8890 100644 --- a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/OnlyRequestEndpointWriter.java +++ b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/OnlyRequestEndpointWriter.java @@ -167,6 +167,7 @@ public CodeBlock getInitializeRequestCodeBlock( FieldSpec clientOptionsMember, GeneratedClientOptions clientOptions, HttpEndpoint endpoint, + String contentType, GeneratedObjectMapper generatedObjectMapper, CodeBlock inlineableHttpUrl, boolean sendContentType) { @@ -192,10 +193,7 @@ public CodeBlock getInitializeRequestCodeBlock( @Override public Void visitTypeReference(HttpRequestBodyReference typeReference) { - builder.add( - ".addHeader($S, $S)\n", - AbstractEndpointWriter.CONTENT_TYPE_HEADER, - AbstractEndpointWriter.APPLICATION_JSON_HEADER); + builder.add(".addHeader($S, $S)\n", AbstractEndpointWriter.CONTENT_TYPE_HEADER, contentType); return null; } @@ -228,10 +226,7 @@ public Void _visitUnknown(Object unknownType) { clientOptionsMember.name, ClientOptionsGenerator.HEADERS_METHOD_NAME, REQUEST_OPTIONS_PARAMETER_NAME); - builder.add( - ".addHeader($S, $S)\n", - AbstractEndpointWriter.CONTENT_TYPE_HEADER, - AbstractEndpointWriter.APPLICATION_JSON_HEADER); + builder.add(".addHeader($S, $S)\n", AbstractEndpointWriter.CONTENT_TYPE_HEADER, contentType); return builder.add(".build();\n").unindent().build(); } } diff --git a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java index dd44ef002f5..3e49a659f81 100644 --- a/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java +++ b/generators/java/sdk/src/main/java/com/fern/java/client/generators/endpoint/WrappedRequestEndpointWriter.java @@ -18,11 +18,7 @@ import com.fern.ir.model.commons.ErrorId; import com.fern.ir.model.commons.NameAndWireValue; -import com.fern.ir.model.http.FileProperty; -import com.fern.ir.model.http.HttpEndpoint; -import com.fern.ir.model.http.HttpMethod; -import com.fern.ir.model.http.HttpService; -import com.fern.ir.model.http.SdkRequest; +import com.fern.ir.model.http.*; import com.fern.java.client.ClientGeneratorContext; import com.fern.java.client.GeneratedClientOptions; import com.fern.java.client.GeneratedEnvironmentsClass; @@ -139,6 +135,7 @@ public CodeBlock getInitializeRequestCodeBlock( FieldSpec clientOptionsMember, GeneratedClientOptions clientOptions, HttpEndpoint _unused, + String contentType, GeneratedObjectMapper generatedObjectMapper, CodeBlock inlineableHttpUrl, boolean sendContentType) { @@ -201,10 +198,7 @@ public CodeBlock getInitializeRequestCodeBlock( clientOptionsMember.name, ClientOptionsGenerator.HEADERS_METHOD_NAME, AbstractEndpointWriter.REQUEST_OPTIONS_PARAMETER_NAME) - .add( - ".addHeader($S, $S);\n", - AbstractEndpointWriter.CONTENT_TYPE_HEADER, - AbstractEndpointWriter.APPLICATION_JSON_HEADER); + .add(".addHeader($S, $S);\n", AbstractEndpointWriter.CONTENT_TYPE_HEADER, contentType); } else { requestBodyCodeBlock.add( ".headers($T.of($L.$L($L)));\n", From de1782117f467e35310b7c0ab155a55be24b4905 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Dec 2024 10:19:36 -0500 Subject: [PATCH 2/6] run java sdk seed tests --- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../contenttype/ContentTypeClient.java | 4 ++-- .../.gradle/8.11.1/checksums/checksums.lock | Bin 17 -> 17 bytes .../8.11.1/checksums/md5-checksums.bin | Bin 20947 -> 20947 bytes .../8.11.1/checksums/sha1-checksums.bin | Bin 23627 -> 23627 bytes .../executionHistory/executionHistory.bin | Bin 29880 -> 29880 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .../.gradle/8.11.1/fileHashes/fileHashes.bin | Bin 21347 -> 21347 bytes .../.gradle/8.11.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .../buildOutputCleanup/cache.properties | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/seed/java-sdk/exhaustive/custom-client-class-name/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/custom-client-class-name/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index e7db2103102..20253b2f456 100644 --- a/seed/java-sdk/exhaustive/custom-client-class-name/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/custom-client-class-name/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/custom-dependency/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/custom-dependency/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/custom-dependency/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/custom-dependency/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/custom-error-names/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/custom-error-names/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 9ccd41fcf75..938fd9b0294 100644 --- a/seed/java-sdk/exhaustive/custom-error-names/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/custom-error-names/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/enable-public-constructors/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/enable-public-constructors/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/enable-public-constructors/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/enable-public-constructors/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/forward-compatible-enums/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/forward-compatible-enums/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/forward-compatible-enums/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/forward-compatible-enums/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/json-include-non-empty/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/json-include-non-empty/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/json-include-non-empty/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/json-include-non-empty/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/local-files/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/local-files/resources/endpoints/contenttype/ContentTypeClient.java index 1b606cf6b8d..b697312666e 100644 --- a/seed/java-sdk/exhaustive/local-files/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/local-files/resources/endpoints/contenttype/ContentTypeClient.java @@ -55,7 +55,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -99,7 +99,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/no-custom-config/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/no-custom-config/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/no-custom-config/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/no-custom-config/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/exhaustive/signed_publish/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java b/seed/java-sdk/exhaustive/signed_publish/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java index 4113789731d..7e31af50665 100644 --- a/seed/java-sdk/exhaustive/signed_publish/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java +++ b/seed/java-sdk/exhaustive/signed_publish/src/main/java/com/seed/exhaustive/resources/endpoints/contenttype/ContentTypeClient.java @@ -52,7 +52,7 @@ public void postJsonPatchContentType(ObjectWithOptionalField request, RequestOpt .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { @@ -98,7 +98,7 @@ public void postJsonPatchContentWithCharsetType(ObjectWithOptionalField request, .url(httpUrl) .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") + .addHeader("Content-Type", "application/json-patch+json; charset=utf-8") .build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/checksums.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/checksums.lock index fdf295b46653d9e9d17c9ec0e134bffbda646973..8a3b233acb590ab1251bef5181b783e22e8f3e97 100644 GIT binary patch literal 17 UcmZQ>a1c8?U-a`+1_+o905T#3&Hw-a literal 17 UcmZSHI(5UtnO5fyGeE!`078=m-~a#s diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/md5-checksums.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/md5-checksums.bin index ad4008f3424c0aa947d7f82e3903f065e65a4581..3e88913d86758abff4383a1ad336e89b82aecefe 100644 GIT binary patch delta 778 zcmXv~Pe@a79Pe#!FIIwP()QkzBFVt$4G(Kzco3nz-)q}@J4nGah^5kDNQb&ekVNIh zgM3(7l2M~ZhoK~mB+9x(6e0H9rUiMZ9V$FnL6?U8{%pU?`+Pp%&*$^~@|>*XWTp9} z-xXcLpg*E6Y}ek+CvST42RlFS;4iv`7yh6$j!pjwm*qo9z2u6uBdr#$7F<=ITy$^4i>k^SuXzlXy|p&bY`5 z1_MELy>2>c&HH{$*!OCt<9Ha*UGWNvfwDBRkZ&y_lAZs z($Y{cib;`HWQ0ivwH2pvmT0ILEsQ)vm1l~J2vRjKGH*r3+lZ9OGNoorni~2{mML{3 zNy!G`q#u8Y&i1?(nYJs)@Ju;{C6nD%Dq@R+@&&Y?5 zdeIi8X5tRR65u+oP72AtxLS6WD9<{vq^O8h*#= z&mrm9N->s8k9p>El>HC(k> jr}70el&A?tb~d6b!CO8eB|rw5gx*AbcSM~xO~3kop#&T{ delta 786 zcmXw#OK1~O7=@i^rK$DNrkc#8ttCTKjhGN2_@WD`oyT>OnSffMRw*t@!JvW`L|jyf zRxk@aq$0l1qHYW=21FMc7g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-!Ls-S}% zBs&Wewn0)eo8Dwor-%Y@GLv4p0G65=m|#=+pV)N4Ki`3MnASjzEp22c%ki&<%N>8H fHKj8N0_3D}alBK_7mlJxGS+n5fTwRMkhtkNdF>-ty`j(<-Rp&G*kqCXNu!yLkd7ehC;=#m?& zRE%*>jz8b@qBG@L`qNHo$yB`yt|vQLjY?;gwW2kI3ZZ2<$|!! zS`a5>SSvDwJk#NUpyb=}NSNi-$P%`BEpmh#z5{tefv>|4p;}O4_fW#9FottNNEpN| z;Z4xtnNTkF!+#`UQtUyHuq!s=m~bsN;fnAn;f_$@X~Pp?*rP<2u;fW2M`-r${Q-Ff B#rpsN delta 438 zcmdn-l5xjN#tr@+I!1-bY3VuHmB~fPMn(B)=@~hB`B{bL`302%@+`L3njBRltl73i zh5yZN>)l-Kv4DxC`QMV+ljXhrS-SrM8AaZ4ES(_66>kfc*C2*~kAzODQE5S5p;<+- zX(%(%F;qe8qL~ zXgzjk!Cg(mD3t>CyaW!H9ShpoHgEEMr@*`xsC99kAxq~vAmc`!2FoN6gC$>`Wig1M zpKr{v6~ssbitGh3Cgy9goCY!W=WDaP0x{m@o3Q)IRRqy6{)ja1Tl6NX|Oy5F`fb$??DW~Vm+3IjX;KTu^LN1h>=^ogJmv=p;^)o E0Ia6QYybcN diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.lock index 09cb867af9b4698694d7f7f3bc2b9777da0c6bd2..af931a05bd134b1329f6d57434db335549b4530b 100644 GIT binary patch literal 17 UcmZR6bIwX*OV+us3=qH$06q8x2mk;8 literal 17 UcmZP$um6}etto#s0|c-G05-D(ZU6uP diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.bin index bbd15b8a1172f6c8bfbd0c430beb851f90cb828a..1d10caee1701224b8e9efd73420bc04c4f3cd6b7 100644 GIT binary patch delta 550 zcmXBRIY7ND2{FtgNik?8YOTh?Q7K3b9fP3$c3dTx{ zXd@`1U=_ST@W3Mxk1VnTB@z^36coI6=AULhX8!k>$7B;qHleIX^|EdKH;z7C6Yyez z@Zgx3z>k1YK7vL=WcHrXOS}O@0f&a>a;}Ocaw!=MnQl}E-6EeyeNYy@pqqHY6p==f z$e=)6qpnqk&(KArFixCchqytWuu;<{!}kagX^atf*d#1G5|{9{%dicDNMV%t#2WFA z2jT-&9U{E1ARu74au_DIutLn@mWV+O$xIwA!~q6~3oH>9t|ZiDXJj90O^;|=fo4-w zs^{n@Cb38y;gs0GA2EoguneyvN_=CEn0LnZ!48Y2Y7AdIeMLh=79`O_BwoOU4>4&wcNpY~qfPw)FYZ+&~qSwlH%IF2~$3(@{MOgc4%z7-^i zW!w=J{0ah#=yvHD;}OC{5g^V`a%o0&bzURO@Qi7n878+`&!3>vEyYue6Z?o0Y1|Nd z_$0Pr^GG;}0FlBHv5q3Kg9?#H+n|JZ;U&^osGbyv9NvjdScW8=hl@yIj=07lae)`& z5-r0LE@40r+QJMGMvideiLj%|tA|5=IEWZx#5^)Y0uO?qU5#u-yRTIhf^X>c>CIpq zQNn}`Vixy=2Y-UG5A^sY>_CKg#2R5!V_Wg+mq#1$!_zBtjYwe%6T|@$L|FCvd?b<(HY0Ufp diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.lock index 37a9fe5e6515d7118a44988d078222c09b818430..ceb63f493a0e56b34ebe229d6011aeacc7ce5743 100644 GIT binary patch literal 17 UcmZR!JvA-8XIrc@0|eLt05SChCjbBd literal 17 UcmZQh>AG8EzohmQ0|eLt05>%RvH$=8 diff --git a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock index f328a64f6d08980cc4ccabcfdfd7c341ca78b7c7..994c2c1f1da9fdd171dfdefe1cf520e5da536d66 100644 GIT binary patch literal 17 UcmZQRwtd%oG3f)23=kj;06Dn?ZvX%Q literal 17 UcmZS1y|&2rbt4Bq0|W>I05RMH%m4rY diff --git a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties index 955c0ec1aaf..a44f3f3f1bb 100644 --- a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties +++ b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Wed Dec 11 01:50:27 UTC 2024 +#Wed Dec 11 15:14:03 UTC 2024 gradle.version=8.11.1 From 48697681f170ca464f2b078903e65c8d03984675 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Dec 2024 10:21:41 -0500 Subject: [PATCH 3/6] Add changelog entry --- generators/java/sdk/versions.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generators/java/sdk/versions.yml b/generators/java/sdk/versions.yml index fc086bfc704..ba31d555203 100644 --- a/generators/java/sdk/versions.yml +++ b/generators/java/sdk/versions.yml @@ -1,3 +1,10 @@ +- changelogEntry: + - summary: | + Apply Content-Type header from endpoint definition in SDK generator. + type: feat + createdAt: '2024-12-11' + irVersion: 53 + version: 2.7.0 - changelogEntry: - summary: | Don't generate pagination with nonempty path. Fixes pagination seed tests breaking. From c67bcbf5ca969bd0f7b1f9833eb169f4b825e60f Mon Sep 17 00:00:00 2001 From: ajgateno Date: Wed, 11 Dec 2024 15:24:49 +0000 Subject: [PATCH 4/6] chore: update changelog --- fern/pages/changelogs/java-sdk/2024-12-11.mdx | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 fern/pages/changelogs/java-sdk/2024-12-11.mdx diff --git a/fern/pages/changelogs/java-sdk/2024-12-11.mdx b/fern/pages/changelogs/java-sdk/2024-12-11.mdx new file mode 100644 index 00000000000..ef7a801845a --- /dev/null +++ b/fern/pages/changelogs/java-sdk/2024-12-11.mdx @@ -0,0 +1,4 @@ +## 2.7.0 +**`(feat):`** Apply Content-Type header from endpoint definition in SDK generator. + + From bcd94099101b9b532a20f50939538dd8d670be2c Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Dec 2024 11:20:38 -0500 Subject: [PATCH 5/6] update ete test --- .../tests/generate/__snapshots__/generate.test.ts.snap | 6 +----- .../update-api-v2/__snapshots__/update-api.test.ts.snap | 8 ++++---- .../update-api/__snapshots__/update-api.test.ts.snap | 8 ++++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap b/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap index 2282c7ba388..0e9d2c1377b 100644 --- a/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap @@ -1,7 +1,3 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`fern generate > missing docs page 1`] = ` -"[docs]: Found 1 errors and 0 warnings. Run fern check --warnings to print out the warnings. -[docs]: docs.yml -> navigation -> 0 -> path - Path missing.md does not exist" -`; +exports[`fern generate > missing docs page 1`] = `"Login required."`; diff --git a/packages/cli/ete-tests/src/tests/update-api-v2/__snapshots__/update-api.test.ts.snap b/packages/cli/ete-tests/src/tests/update-api-v2/__snapshots__/update-api.test.ts.snap index b90172bda23..c74de106748 100644 --- a/packages/cli/ete-tests/src/tests/update-api-v2/__snapshots__/update-api.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/update-api-v2/__snapshots__/update-api.test.ts.snap @@ -1220,16 +1220,16 @@ exports[`fern api update unioned > fern api update unioned 1`] = ` "type": "string", "description": "The starting station of the trip", "examples": [ - "Berlin Hauptbahnhof", - "Paris Gare du Nord" + "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", + "b2e783e1-c824-4d63-b37a-d8d698862f1d" ] }, "destination": { "type": "string", "description": "The destination station of the trip", "examples": [ - "Paris Gare du Nord", - "Berlin Hauptbahnhof" + "b2e783e1-c824-4d63-b37a-d8d698862f1d", + "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e" ] }, "departure_time": { diff --git a/packages/cli/ete-tests/src/tests/update-api/__snapshots__/update-api.test.ts.snap b/packages/cli/ete-tests/src/tests/update-api/__snapshots__/update-api.test.ts.snap index 33948a99afb..caf63fbb409 100644 --- a/packages/cli/ete-tests/src/tests/update-api/__snapshots__/update-api.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/update-api/__snapshots__/update-api.test.ts.snap @@ -1220,16 +1220,16 @@ exports[`fern api update > fern api update 1`] = ` "type": "string", "description": "The starting station of the trip", "examples": [ - "Berlin Hauptbahnhof", - "Paris Gare du Nord" + "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", + "b2e783e1-c824-4d63-b37a-d8d698862f1d" ] }, "destination": { "type": "string", "description": "The destination station of the trip", "examples": [ - "Paris Gare du Nord", - "Berlin Hauptbahnhof" + "b2e783e1-c824-4d63-b37a-d8d698862f1d", + "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e" ] }, "departure_time": { From 8aa234b256f4b61cb207b2c2b55b04a5c265f20d Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Dec 2024 11:30:14 -0500 Subject: [PATCH 6/6] revert changes on test --- .../src/tests/generate/__snapshots__/generate.test.ts.snap | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap b/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap index 0e9d2c1377b..2282c7ba388 100644 --- a/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/generate/__snapshots__/generate.test.ts.snap @@ -1,3 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`fern generate > missing docs page 1`] = `"Login required."`; +exports[`fern generate > missing docs page 1`] = ` +"[docs]: Found 1 errors and 0 warnings. Run fern check --warnings to print out the warnings. +[docs]: docs.yml -> navigation -> 0 -> path + Path missing.md does not exist" +`;